You don't compare them. The TreeMap class code does that.
Did you read the API doc for the TreeMap class?
Type: Posts; User: Norm
You don't compare them. The TreeMap class code does that.
Did you read the API doc for the TreeMap class?
Read the API doc for the put() method. It says it will throw that exception if the node being added cannot be compared. That would mean the class needs to implement Comparable.