I think that
you should have a look at the spec the check how the convertions behave. Here is a part of it :
JSP.2.3.5.6 A {<,>,<=,>=,lt,gt,le,ge} B
� If A or B is String coerce both A and B to String, compare lexically
This is your second example
� If A is Comparable, then:
If A.compareTo (B) throws exception, error.
Otherwise use result of A.compareTo(B)
This is your first example (Integer implements Comparable)