title: Method comparing the reverse order of integers
body: <p>I am trying to compare the reverse order of the two integers, but for some reason it is giving me <code>true</code>. I am trying to figure out where is my mistake but can't seem to find it.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    int a=4234;
      int b=4326;
  
      System.out.print(reverseSame(a,b));
  }
  
  public static boolean reverseSame(int a, int b) {
      int n1=0;
      int n2=0;
      int temp1=a;
      int temp2=b;
  
      while(temp1&gt;0) {
          temp1/=10;
          n1++;
      }
  
      while(temp2&gt;0) {
          temp2/=10;
          n2++;
      }
  
      if (n1!=n2)
          return false;
      else {
          boolean isEqual=true;
  
          int []arrA = new int[n1];
          int []arrB = new int[n1];
  
          for (int i=n1-1; i&gt;=0; i--) {
              arrA[i]=temp1%10;
              arrB[i]=temp2%10;
  
              temp1/=10;
              temp2/=10;
          }
  
          for (int i=0; i&lt;n1/2;i++) {
              if (arrA[i]!=arrB[n1-i-1]) {
                  isEqual=false;
              }
          }
          return isEqual;
      }
  }
  </code></pre>