Write a java program to check palindrome

As we know that palindrome is a number or word which see same after seeing in both direction.Examples: 121, POP etct...
Here is a java program which show the give number is palindrome or not.

class palindromeCheck
{
  public static void main(String as[])
 {
System.out.println("Please enter the number");
  int n=Integer.parseInt(as[0]); 
  int rem=0,res=n,rev=0;
  while(n>0)
  {
   rem=n%10;
   n=n/10;
   rev=rev*10+rem;
   }
  if(res==rev)
  System.out.println("palindrome");
  else
  System.out.println("not palindrome");
}

}