class Test def main is shared assert Num(5) == Num(5) assert Num(5) <> Num(6) assert Num(5) < Num(6) assert Num(5) <= Num(5) assert Num(5) <= Num(6) assert Num(6) > Num(5) assert Num(6) >= Num(6) assert Num(6) >= Num(5) assert Num2(6) > Num2(5) class Num implements IComparable var _n as int cue init(n as int) base.init _n = n def equals(obj as Object?) as bool is override if obj inherits Num return _n == obj._n else return false def getHashCode as int is override return _n.getHashCode def compareTo(obj as Object) as int if obj inherits Num print _n, obj._n return _n.compareTo(obj._n) else return 1 class Num2 implements IComparable # has overload of compareTo var _n as int cue init(n as int) base.init _n = n def equals(obj as Object?) as bool is override if obj inherits Num2 return _n == obj._n else return false def getHashCode as int is override return _n.getHashCode def compareTo(obj as Object) as int if obj inherits Num2 print _n, obj._n return _n.compareTo(obj._n) else return 1 def compareTo(num2 as Num2) as int return _n.compareTo(num2._n)