1class Main
2{
3public static void main(String args[])
4{
5String a, b = "";
6Scanner in = new Scanner(System.in);
7System.out.println("Enter the string");
8a = in.nextLine();
9int length = a.length();
10for (int i = length - 1; i >= 0; i--)
11b = b + a.charAt(i);
12if(a.equals(b))
13System.out.println("The string is a palindrome.");
14else
15System.out.println("The string is not a palindrome.");
16}
17}