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 are the advantages of defining packages in java?
We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.
What is the difference between a constructor and a method?
What is int argc char * argv?
What are different types of arrays?
How many functional interfaces does java 8 have?
give an example for encapsulation?
Explain the difference between jvm and jre?
What exceptions occur during serialization?
Can a final method be overloaded?
What do you mean by garbage collection used in java?
How does list work in java?
What languages are pass by reference?
What is a function easy definition?
Why char array is favored over string for the storage of passwords?