Virtusa interview question

write code of palindrome in java?