title: Function to detect numerical palindromes not working as expected
body: <p>I'm a beginner in programming. Can you please tell me what's wrong with my code? The code shows not palindrome, although the number is a palindrome.</p>
  
  <pre><code>public static void main(String[] args) {
      // TODO code application logic here
      Scanner in = new Scanner(System.in);
      int a =0;
      int n =in.nextInt();
      while(n &gt;0){
          int temp =n %10;
          a = a*10+temp;
          n = n/10;
      }
      System.out.println(a);
      if( n ==a){
          System.out.println("The number is palindrome");
      }else{
          System.out.println("The number is not palindrome");
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>16461
  16461
  The number is not palindrome
  </code></pre>