compareTo and nested Enums
<p>in "<a href="http://www.ii.uib.no/~khalid/pgjc3e/" rel="nofollow">A Programmers Guide to Java SCJP Certification</a>" I found an example which I can't follow.</p>

<p>This the given enum:</p>

<pre><code>enum Scale3 {
    GOOD(Grade.C), BETTER(Grade.B), BEST(Grade.A);

    enum Grade {A, B, C}

    private Grade grade;

    Scale3(Grade grade) {
        this.grade = grade;
    }

    public Grade getGrade() { return grade; }
}
</code></pre>

<p>This is the given expression:</p>

<pre><code>Scale3.GOOD.getGrade().compareTo(Scale3.Grade.A) &gt; 0;
</code></pre>

<p>I don't understand why this expression will be true?<br>
The return value will be 2.</p>

<p><em>compareTo()</em> will return a value > 0 if the given object is "less" than the object.  </p>

<p><em>Scale3.Grade.A</em> is the "biggest" element of Grades, its ordinal number is 0.  </p>

<p><em>Scale3.GOOD</em> is the "biggest" element of Scale3, its ordinal number is also 0.  </p>

<p>The constructor of <em>Scale3</em> is called with <em>Scale3.Grade.C</em>, which ordinal number is 2.</p>

<p>So the given expression is equal to the following code:</p>

<pre><code>Scale3.Grade.C.compareTo(Scale3.Grade.A) &gt; 0;
</code></pre>

<p><em>A</em> is "bigger" than <em>C</em>, so shouldn't be the result &lt; 0?</p>
