title: Why Java does not see that Integers are equal?
body: <p>I have integers that are supposed to be equal (and I verify it by output). But in my <code>if</code> condition Java does not see these variables to have the same value. </p>
  
  <p>I have the following code:</p>
  
  <pre><code>if (pay[0]==point[0] &amp;&amp; pay[1]==point[1]) {
      game.log.fine("&gt;&gt;&gt;&gt;&gt;&gt; the same");
  } else {
      game.log.fine("&gt;&gt;&gt;&gt;&gt;&gt; different");
  }
  game.log.fine("Compare:" + pay[0] + "," + pay[1] + " -&gt; " + point[0] + "," + point[1]);
  </code></pre>
  
  <p>And it produce the following output:</p>
  
  <pre><code>FINE: &gt;&gt;&gt;&gt;&gt;&gt; different
  FINE: Compare:: 60,145 -&gt; 60,145
  </code></pre>
  
  <p>Probably I have to add that <code>point</code> is defined like that:</p>
  
  <pre><code>Integer[] point = new Integer[2];
  </code></pre>
  
  <p>and <code>pay</code> us taken from the loop-constructor:</p>
  
  <pre><code>for (Integer[] pay : payoffs2exchanges.keySet())
  </code></pre>
  
  <p>So, these two variables both have the integer type.</p>