Java Palindrome checker - made it more generic to check for number or text