Palindrome Program In Java With Examples

Palindrome Program

What is a Palindrome?

A palindrome is a Number/String that is the same after reverse.

Example 1: 5445,6556,455554.

Example 2: mom, repaper, tenet.

Write a program to check the given string palindrome or not?

Solution 1: By using StringBuffer.

Output :

mom is Palindrome
repaper is Palindrome
clarifyall is not Palindrome

Solution 2: By using for loop.

Output:

tenet is palindrome.
repaper is palindrome.
java is not palindrome.

About Manohar

I, Manohar am the founder and chief editor of ClarifyAll.com. I am working in an IT professional.

View all posts by Manohar →

Leave a Reply