import java.util.Scanner;
public class MethodTestingLab {
public static void main(String[] args) {
int menuChoice, num1;
Scanner keyboardReader = new Scanner(System.in);
// Display Menu
System.out.println("Menu\n 1.chkNextInt\n 2.twoDigitNumber\n 3.big2Digits\n 4.reverseString\n 5.max3\n");
// User choice
System.out.print("Enter your choice ");
menuChoice = keyboardReader.nextInt();
// Cases
switch(menuChoice) {
case 4:
System.out.println("Given a three-lettered string, returns the string that is the reverse of its characters.");
System.out.print("Enter a string: ");
case4String = keyboardReader.next();
System.out.println(reverseString(case4String));
break;
}
System.out.println("End");
}
// Method 4
public static String reverseString(case4String) {
newString = case4String.charAt(2) + case4String.charAt(1) + case4String.charAt(0);
return newString;
}
}
// How do I fix the identify error in Method 4? I can't compile it until it is fixed, and when I tried adding String before case4String, it caused way more errors than the one before.