*************************************************************
COMPLETE SOURCE CODE FOR : ReverseString.java
*************************************************************
public class ReverseString
{
public static void main(String[]args)
{
String a="i love you";
StringBuffer b=new StringBuffer(a);
System.out.println(b.reverse());
}
}
*************************************************************
LIKE USUAL, JUST COMPILE AND EXECUTE IT
*************************************************************
*************************************************************
COMPLETE SOURCE CODE FOR : MySimplestPalindromeChecker.java
*************************************************************
import javax.swing.JOptionPane;
public class MySimplestPalindromeChecker
{
public static void main(String[]args)
{
String a=JOptionPane.showInputDialog(null,"What word that you want to check ?","Palindrome Checker",JOptionPane.QUESTION_MESSAGE);
if(a!=null)
{
String b=a;
StringBuffer c=new StringBuffer(b);
if(a.equals(c.reverse().toString()))
{
JOptionPane.showMessageDialog(null,"THIS IS A PALINDROME WORD");
}
else
{
JOptionPane.showMessageDialog(null,"THIS IS NOT A PALINDROME WORD");
}
}
}
}
*************************************************************
JUST COMPILE AND EXECUTE IT
*************************************************************