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
Why should we use singleton pattern instead of static class?
Is java based on c?
What is polymorphism in java? What are the kinds of polymorphism?
What is a container in a gui?
Can java inner class be static?
what is the difference between yielding and sleeping? : Java thread
Is java a software?
Can list be final in java?
What is the difference between sop and work instruction?
Explain the difference between runnable and callable interface in java?
Difference between final and effectively final ?
What is the use of private static?
What is visibility mode?
What is abstract class constructor called?
Can we define a package statement after the import statement in java?