java.lang.ClassCastException: MyClass cannot be cast to java.lang.Comparable

Posted by chuck on Stack Overflow See other posts from Stack Overflow or by chuck
Published on 2010-03-24T01:32:46Z Indexed on 2010/03/24 1:33 UTC
Read the original article Hit count: 541

Filed under:
|

List myclassList = (List) rs.get();

TreeSet<MyClass> myclassSet = new TreeSet<MyClass>(myclassList);

I don't understand why this code generates this:

java.lang.ClassCastException: MyClass cannot be cast to java.lang.Comparable

© Stack Overflow or respective owner

Related posts about java

Related posts about classcastexception