incomparable type in java
<p>I have got this code, and I get an error <code>incomparable types: java.lang.String and int</code>, for this line of code 
    <code>if ((this.name.String.compareTo(obj.name == 0)) &amp;&amp; (this.age = obj.age))</code></p>

<p>The method is this: </p>

<pre><code>public int compareTo(Object o)
{
    int result;
    AnyClass obj = (AnyClass)o;
    if ((this.name.String.compareTo(obj.name == 0)) &amp;&amp; (this.age = obj.age))
    {
        result = 0;
    }
   else if (this.name.compareTo(obj.name) &gt; 0)
    {
        result = 1;
    }
    else
    {
        result = -1;
    }
    return result;
}
</code></pre>
