I finally got this program of finding string palindromes!

It may be a bit too long, and there might be shorter methods to do this... but I did this using JAVA...


import java.io.*;
import java.lang.String.*;
class Palindrome {
public static void main(String[] args)throws IOException {
InputStreamReader read= new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(read);
System.out.println("Enter a string to check if it is a palindrome");
String name=in.readLine();
int z=name.length();
int yo;
String rev="";
for(int i=z-1;i>=0;i--){
char t=name.charAt(i);
rev+=t;
}
System.out.println(rev);
if(rev.equals(name)) {
System.out.println("Palindrome");
}
else {
System.out.println("Not a palindrome");}
}}