title: Java (1 != 1) is true
body: <p>I have an <code>if</code> statement in my code as follows:</p>
  
  <p><code>if (key != a[0]) /* line to be executed */</code></p>
  
  <p>When I run my program with <code>key = 1</code> (type Integer) and <code>a[0] = 1</code> (type Integer), I get a <code>true</code> and the statement runs, i.e. 1 does not equal 1. Obviously, this is absurd. </p>
  
  <p>I've done a lot of testing on this, and I can't find a value of <code>key</code> that will give me a <code>false</code> for <code>key != a[0]</code>. <code>a[0]</code> can't change, for the purposes of my program. </p>
  
  <p>What's wrong? </p>