Capgemini Interview Question

WAP to check string is palindrome or not in Java and explain the code?