Sample code to retrieve objects from HashMap in sorted
ascending order?

Answer Posted / murli

Map hm = new HashMap();
//add values to hashmap
Map tm = new TreeMap(hm);
//Iterate keySet in tm

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by the bean persistent property?

549


What is map in java?

514


Can we catch more than one exception in a single catch block?

622


Why java applets are more useful for intranets as compared to internet?

577


What is the purpose of a volatile variable?

550






What is array command?

553


What is method reference?

514


What is type conversion in java?

572


Is object a data type?

555


What is the use of isempty in java?

535


How do you write methodology?

558


What is Applet Stub Interface ?

1962


What is downcasting?

567


What is java thread dump, how can we get java thread dump of a program?

569


Describe the various concepts related to object oriented programming (oop).

582