XYZ interview question

write palindrome program. about Java oops concepts