Java program to print whether the given string is a palindrome

Java Programming Java8Object Oriented Programming

A given string is called a palindrome if the reverse of the string is the string itself. For example, the strings “mom”, “bob”.


1. Get the number to check for palindrome
2. Hold the number in a temporary variable
3. Reverse the number
4. Compare the temporary number with the reversed number
5. If both numbers are same, print "palindrome number"
6. Else print "not palindrome number"


But if we want to check if "Madam" is palindrome or not , it will show us that it is not a palindrome because of the upper case of first letter.

Updated on 13-Mar-2020 05:34:04