How TreeMap sorts the objects inside it?? suppose if have
include one employee object and one car object. On what
basis it will sort?
Answers were Sorted based on User's Feedback
Answer / anuj
then u have to tell the trremap that on what basis elment
shoyuld be sorted all elemtns of trremap should be of type
comparable & in side comparable compare to u need to put
uor sorting logic.
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / 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 |
Answer / naveen.bav
Hello Venkatesh, I am not asking for synchronization. I am
asking how TreeMap will sort the values inside it.Thanks
for the reply
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / malligontla
Tree Map working according to the Ascending order.
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / venkatesh
call static method from Collections class
below is method:
static Map synchroizedMap(MaP Object)
| Is This Answer Correct ? | 2 Yes | 9 No |
What are the three parts of a lambda expression?
What is a boolean expression in java?
What is method Overriding in the perspective of OOPS?
What is the base class of all exception classes in java?
Can java cast null?
What is the use of arraylist class in java?
What is singleton class in ruby?
Is a string literal?
What is the numeric promotion?
What are the rules for naming an array?
what value will be return by the read() method once it reaches the end-of-file? a. Throws EOException b. Return null c. Return -1 d. Read method return nothing, because it is void method
Diff between C++ and java?