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
What do you understand by the bean persistent property?
What is map in java?
Can we catch more than one exception in a single catch block?
Why java applets are more useful for intranets as compared to internet?
What is the purpose of a volatile variable?
What is array command?
What is method reference?
What is type conversion in java?
Is object a data type?
What is the use of isempty in java?
How do you write methodology?
What is Applet Stub Interface ?
What is downcasting?
What is java thread dump, how can we get java thread dump of a program?
Describe the various concepts related to object oriented programming (oop).