Implementing the equals method in java
<p>This is my implementation of the equals class for a Coor class which is just contains 2 ints x and y. would this be the proper way of implementing this method?</p>

<pre><code> public boolean equals(Object obj) {
        if (obj == null || obj.getClass() != this.getClass()) {
            return false;
        }
        Coor temp = (Coor) obj;
        if (temp.x == this.x &amp;&amp; temp.y == this.y) {
            return true;
        } else {
            return false;
        }
    }
</code></pre>
