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
If try block is successfully executed, Then Is Finally block executed?
How do I run java on windows?
Explain about doubly linked list
What does I ++ mean?
How do you use spaces in java?
Is java a pure object oriented language?
What is the purpose of a transient variable?
What is the purpose of the finalize() method?
Is .net better than java?
What methods are used to get and set the text label displayed by a button object?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
How is hashcode calculated in java?
What are the important methods of java exception class?
What is package private scope in java?
What is merge sort in java?