Java Program for Palindrome Number

Here you will get java program for palindrome number.

A number is said palindrome if its is equal to its reverse. For example, 131 is palindrome while 123 is not.

Below I have shared two ways to check palindrome in java.

Java Program for Palindrome Number

Method 1:

In this method we will reverse the number and then compare it with original number.


Enter a number:
Number is Palindrome


Method 2:

In this method we will first convert the number into string and then reverse the string. If reversed string is equal to original then number is palindrome otherwise not.


Enter a number:
Number is Not Palindrome

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.