Java program to check whether a given string is palindrome or not