i have wrote java function reversing user input but it nor working and i don't have any idea where is the problem and how to solve it.
import java.util.Scanner;
class Reverse{
public static void main(String args[]){
Scanner word = new Scanner(System.in);
System.out.print("type the word here to check if it is palindrome: ");
String n = word.nextLine();
char[] let = n.toCharArray();
System.out.print(revrse(i, let));
// for (int i=let.length-1; i>=0; --i){
// System.out.print(let[i]);
// }
}
public static int reverse(char[] let){
for (int i=let.length-1; i>=0; --i){
return let[i];
}
}
}
how to make this code to work.