Palindrome Number in Function

Program to create non-return type method named Palindrome() and check a number whether it is a Palindrome Number or not. Call the method inside the main() method.

Palindrome Number is a number which is equal to reverse of the itself.

Example 1: 131 if reversed is also 131. Hence it is a Palindrome Number.

Example 2: 123 if reversed is 321. Hence it is not a Palindrome Number.

Java
import java.util.*;
public class PalindromeNumber
{
    public void Palindrome()
    {
        int n=0,s=0,r=0,temp=0;
        Scanner sc=new Scanner (System.in);
        System.out.print("Enter a number: ");
        n=sc.nextInt();
        temp=n;
        while (n>0)
        {
            r=n%10;
            s=(s*10)+r;
            n=n/10;
        }
        if (temp==s) 
        {
            System.out.println(temp+" is a Palindrome Number.");
        }
        else 
        {
            System.out.println(temp+" is not a Palindrome Number.");
        } 
    }
    public static void main(String args[])
    {
        PalindromeNumber ob=new PalindromeNumber();
        ob.Palindrome();
    }
}
Java