Recursive methos called isReverse
Hej, jeg er ved at lære recursion og har denne opgave. Write a recursive method called isReverse that accepts two strings as parameters and returns true if the two strings contain the same sequence of characters as each other but in the opposite order (ignoring capitalization), and false otherwise. f.eks the call isReverse("hello", "oLLeH") would return true.kan ikke finde ud af hvordan jeg skal checke hvert char?
public static void isReverse(String a, String b) {
if (a.length() == 0) {
System.out.print(a);
} else {
char A = a.charAt(a.length()-1);
char B = b.charAt(b.length()-1);
System.out.print(B);
isReverse(a.substring(0, a.length()-1), b.substring(0, b.length()-1));
System.out.print(A);
}
}