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
Is string pool garbage collected?
What does singleton mean in java?
What is array and arraylist in java?
What is a literal coding?
What is the difference between abstract classes and interfaces?
Implementations of set interface?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
Explain the inheritance?
What happens if we don’t override run method ?
How will you load a specific locale?
What does business logic mean?
What does string mean in java?
How do I write a self declaration?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
How do you clear an arraylist in java?