title: Palindrome number in java doesn't seem to make sense
body: <p>I'm doing some exercise programs in Java and came to this palindrome number exercise which tells if the number is palindrome, I'm getting the correct output but I'm trying to explain to myself how the program is working line by line, upon reaching a specific line I noticed that that part doesn't seem to add up, here is the code:</p>
  
  <pre><code>public class Palindrome {
  
      public static void main(String[] args) {
          int p = 252;
          if(isPalindrome(p)) {
              System.out.println("Palindrome");
          } else {
              System.out.println("Not palindrome");
          }
      }
  
      public static boolean isPalindrome(int x) {
          int num = x;
          int rev = 0;
  
          while (num != 0) {
              int rmd = num % 10;//the remainder of 252 is 2
              rev = rev * 10 + rmd;//rev which is 0 multiplied by 10 is 0 + 2 is 2
              num = num / 10;
          }
          if (x == rev) {//x = 252 and rev = 2
              return true;
          }
          return false;
      }
  }
  </code></pre>
  
  <p>in the part: <code>if(x == rev)</code> how can it be true when 252 is not equal to 2? thanks guys..</p>