How TreeMap sorts the objects inside it?? suppose if have
include one employee object and one car object. On what
basis it will sort?
Answer Posted / shaik baji
The TreeMap sorts the objects in assending order by
depending on the key value.
The Key value must be "String" type so internally it will
sort the keys by using "compareTo" method.
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the base class of all classes?
What is the maximum size of a string in java?
What is method in java with example?
Why call by value prevents parameter value change?
What is difference between iterator and enumeration in java?
What is method in research paper?
Can the garbage collection be forced by any means?
What is java volatile?
What does this mean java?
Why is stringbuffer faster than string?
Explain about the interpreter in java?
Why do we need autoboxing in java?
Can we call thread start () twice?
What is a java object and java application?
Can we have two main methods in a java class?