Write a java program to take string as an input and check whether it is Palindrome or not.
class PQR
{
public static void main(String k)
{
int l=k.length();
String m=””; //empty
for(int i=l-1;i>=0;i–)
{
m=m+(k.charAt(i));
}
if(m.compareTo(k)==0)
{
System.out.println(“Yes, string is paindrome”);
}
else
{ System.out.println(“No, string is not paindrome”);}
}
}
In this post I have shared a java program which is mostly asked by students of computer science.
THANK YOU FOR VISITING OUR BLOG.
For more related posts and anime, programing ,gaming post please regularly check our blog.