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
How can you make a class serializable in java?
What is the difference between conversation & casting?
Given a singly linked list, determine whether it contains a loop or not without using temporary space?
Can an unreferenced object be referenced again?
How many types of design patterns are there?
Can inner class have constructor?
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
What is local variable and instance variable?
What is a flag variable?
What are predicates in java 8?
When can we say that threads are not lightweight process in java?
What is regex in java?
Write a function for palindrome and factorial and explain?
when you will synchronize a piece of your code? : Java thread
How do I find and replace in word?