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 / 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 |
Post New Answer View All Answers
Can we use static class instead of singleton?
What is map and hashmap in java?
Does a function need a return?
What is a singleton puppy?
Which software is used for java programming?
Can we extend a class with private constructor?
When do we use hashset over treeset?
When will you define a method as static?
What about main() method in java ?
What is the difference between a break statement and a continue statement?
Can we overload the main() method?
Can we have more than one package statement in the source file?
What is jrmp?
What’s the difference between unit, integration and functional testing?
What is a package in java? List down various advantages of packages.