This java program detects whether the input is a palindrome