C
cat_dog_ass
This is my program:
-----------------------------------------------------------------------------
public class Palindrome
{
public static void main(String[] args)
{
String str1= new String("malayalam");
StringBuffer str2= new StringBuffer(str1);
StringBuffer str3= new StringBuffer(str1);
str2.reverse();
System.out.println("First String:"+str2+ " Length:"+str2.length());
System.out.println("Second String:"+str3+ " Length:"+str3.length());
if (str2.equals(str3))
System.out.println("Was a palindrome");
else
System.out.println("Was not a palindrome");
}
}
-----------------------------------------------------------------------------
public class Palindrome
{
public static void main(String[] args)
{
String str1= new String("malayalam");
StringBuffer str2= new StringBuffer(str1);
StringBuffer str3= new StringBuffer(str1);
str2.reverse();
System.out.println("First String:"+str2+ " Length:"+str2.length());
System.out.println("Second String:"+str3+ " Length:"+str3.length());
if (str2.equals(str3))
System.out.println("Was a palindrome");
else
System.out.println("Was not a palindrome");
}
}