Java Check If String Is Palindrome Or Not In Cpp