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

What is a instance variable in java?

541


Explain how to convert any java object into byte array.

540


What is the difference between instanceof and isinstance?

557


Is an integer an object?

512


What is a class in java?

574






Explain super keyword in java.

572


This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

555


Why do you canvas?

601


can any body body expalin best definitions & best real time exaples for opps concepts.

1832


What do negative exponents mean?

540


What is the largest long allowed by java?

530


What is multithreading in java?

542


Is it possible to write a regular expression to check if string is a number?

536


What is a line separator in java?

533


What is meant by distributed application? Why are we using that in our application?

543