Infosys interview question

java code to test if a string is a palindrome