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
Which is dependent variable?
What is the purpose of nested class in java?
What is difference between float and double?
What are the characteristics of java?
Can we have static methods in an interface?
Is a method a procedure?
What is the difference between java applets and applications?
Where pragma is used?
What is class and object in java?
What are the skills required for core java?
What is polymorphism and what are the types of it?
How to Sort Strings which are given in List and display in ascending order without using java api.
take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).
What are the advantages of java over C++?
What is proper subset?