Check whether given String is Palindrome or not in Java

This article will help you to understand Java Program to Check Palindrome.

Palindrome is a String or numeric value which remains same after reversing it. e.g. 12321, 345543, KANAK, MADAM etc. We can check if given string is palindrome or not by reverse it and then compare it with original string.

Java Program to Check Palindrome

Output

Madam is Palindrome.

Now try some string, say “abcdef” which is not palindrome. It’s already given as commented in program.

Output

abcdef IS NOT palindrome.
It's good to share...Share on FacebookTweet about this on TwitterShare on LinkedInPin on PinterestShare on Google+Email this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *