title: Number palindrome code not working
body: <p>I'm working my way through Project Euler, and on problem 4 my palindrome code isn't working. Specifically, it returns 998001 (999*999) as if it were a palindrome.</p>
  
  <p>The code to check the palindrome works, but it keeps looping and replacing the max value despite it not being a palindrome. What am I missing?</p>
  
  <p>Thanks for your help</p>
  
  <pre><code>public int palindromeNumber()
  {
      int max=0;
      for(int x = 100; x&lt;1000; x++)
      {
          for(int y = 100; y&lt;1000; y++)
          {
              int z = x*y;
              StringBuilder num = new StringBuilder(Integer.toString(z));
              StringBuilder rev = num.reverse();
              if(num==rev)
              {
                  max=z;
              }
          }
      }
      return max;
  }
  </code></pre>