By: Prem Tiwari | Last Updated:
In this tutorial, I will explain how to write a palindrome program in java programming language. A palindrome number is a number which remains the same number when its digits are reversed.
Follow the below steps to check the palindrome number.
Step 1) Holds the entered number in a temporary variable.
Step 2) Reverse that number.
Step 3) Compare the reversed number with temporary variable
Step 4) If both numbers are same, then the entered number is a palindrome number.
Copy the below program and execute it with the help of Java compiler.
public static void main(String args)
r=n%10; //getting remainder
System.out.println("This is a Palindrome Number.");
System.out.println("This is not a Palindrome Nunmber.");
Below is the output of above program. If you want to check the another number, then change the value of
This is a Palindrome Number
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari