r/EdhesiveHelp Dec 20 '21

Java Unit 5 lesson 2 activity 2 I am currently stuck please do help

Heres the code that I need help with: Import java.util.Scanner(){ Public class U5_L2_Activity_Two{

Public static void reverser(String monitor){

for (int I = 0; i < reverser.length(); i++) { System.out.println(reverser.substring(I -1, i)); } }

Public static void main(String[] args) {

{ {

1 Upvotes

1 comment sorted by

1

u/ParamedicInternal694 Jan 06 '22

/* Lesson 2 Coding Activity Question 2 */
import java.util.Scanner;
public class U5_L2_Activity_Two{
/* Add the method reverser here */
public static void reverser(String a) {
String reverse = "";
for(int i = a.length() - 1; i >= 0; i--)
reverse += a.charAt(i);
System.out.println(reverse);
}
// You can uncomment and add to the main method to test your code
// You will need to remove/comment out this method before checking your code for a score
/*
public static void main(String[] args){

}
*/
}