How does "if(new Integer(1) == new Integer(1))" work in Java?
<pre><code>if(new Integer(1) == new Integer(1)) return true;
</code></pre>

<p>I need to code/implement this so that this test:</p>

<pre><code>//door is a class and the constructor takes length, breadth, width
if(new Door(10,10,10) == new Door(10,10,10))
</code></pre>

<p>will return true.</p>

<p>Does the Java compiler have any interface for wrapper classes to get their value and compare them?</p>

<p>Or simply: how does one check that <code>some object &gt; other object</code> (user defined object but not by some primitive value/wrapper class)?</p>
