Java Program to check the string for Palindrome.1 min read

A string is said to be in a Palindrome if it remains the same when its elements are reversed or are the same as forward.
For example: 14141, 777, 272 are palindrome numbers as they remain the same even if reversed. If we take an example of ‘mam’ or ‘madam’, these are also palindrome words.


Java program to check String is palindrome or not

Output:


Using StringBuilder’s reverse() function:

Java program to check String is palindrome or not using the StringBuilder reverse() function. This function takes the string and reversed it or take each of the elements from backward.

Output:

Java Program to check the Palindrome Number
Java Interview Programs
Java Programs