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 is a constructor, constructor overloading in java?
What does int [] mean in java?
Is ++ operator is thread safe in java?
What are streams in java 8?
What is callable java?
How can we pass argument to a function by reference instead of pass by value?
Which sorting algorithm is in place?
Discuss 2D arrays.
What is an empty string in css?
what is instanceof operator used in java?
Can you explain the private protected field modifier?
Can we override constructors?
What are the main differences between the java platform and other platforms?
Why string is not thread safe?
What is a parameter used for?