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


Please Help Members By Posting Answers For Below Questions

How do you start a new line in java?

615


What is a function easy definition?

619


What is string [] args?

653


What is charat java?

616


What is initial size of arraylist in java?

625






Is java 1.7 the same as java 7?

650


Give me an example of array and linked list? Where they can be used?

647


What is variable and its types?

638


How big is a 32 bit integer?

642


What is Java Reflection API? Why it’s so important to have?

687


What is ternary operator?

648


What are design patterns and please explain?

677


What is constructor and its types?

639


What are thread safe functions?

603


Differentiate between stringbuffer and stringbuilder in java.

632