Just follow the program to find Palindrome in java:
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Palindrome {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s1 = new String();
s1 =br.readLine();
s1 = s1.toLowerCase();
String s2 = new StringBuffer(s1).reverse().toString();
if(s1.equals(s2)){
System.out.println("Palindrome");
}else
System.out.println("Not Palindrome");
}
}
very nice tricksMy Site
ReplyDeletemany thanks for permitting me to comment!
ReplyDeleteWeb Designing Training In Bangalore
Web Design Courses In Bangalore
Java Training In Bangalore
iOS Training In Bangalore
That's great to read. Thanks for sharing such an informative and useful blog.
ReplyDeleteJava course in Pune