Java Comparable interface: compareTo int attributes
<p>Two objects of the same type each have int attributes called intValue. How can the Comparable interface be used to compare these two objects on the basis of their intValue int values?</p>

<pre><code>  public int compareTo(myObject other) {
    return (this.intValue).compareTo(other.intValue);
  }
</code></pre>

<p>    </p>

<pre><code>firstObject.compareTo(secondObject);
</code></pre>

<p>This produces the error</p>

<pre><code>error: int cannot be dereferenced
</code></pre>