In this tutorial how to create a Program to check a number is palindrome or not in Core Java is shown.
Code:
Palindrome.java
class Palindrome
{
public static void main(String args[])
{
int number=Integer.parseInt(args[0]),sum=0,r,copyn;
copyn=number;
while(copyn>0)
{
r=copyn%10;
sum=(sum*10)+r;
copyn/=10;
}
if(sum==number)
System.out.println(number+” is Palindrome Number”);
else
System.out.println(number+” is not Palindrome Number”);
}
}