Cognizant interview question

asked to make palindrome code in java