Program in Java to check a number is palindrome or not

import java.util.*;
public class prac2{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int reversed = 0;
        int remainder;
        System.out.println("Enter an integer: ");
        int original = n;
        // reversed integer is stored in reversed variable
        while (n != 0) {
            remainder = n % 10;
            reversed = reversed * 10 + remainder;
            n /= 10;
        }

        // palindrome if orignal and reversed are equal
        if (original == reversed){
            System.out.println("is a palindrome."+original);
        }else
        {
            System.out.println("is not a palindrome."+original);
        }
    }
}

OUTPUT

Enter an integer: 1001
1001 is a palindrome.