posted 17 years ago
Above code throws ClassCastException at line 6.
i know that for TreeSet its elements should be mutally comparable.
if i replaces Comparator with Comparable then class
compiles and runs fine but elements doesnot sorting.
I am not able to understand why
thanks.