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
Is it possible to compare various strings with the help of == operator? What are the risks involved?
Explain the private field modifier?
Can we store variables in local blocks?
What is high level language in computer?
What is the do while loop syntax?
What is java full form?
What is passed by reference and pass by value ?
Is oracle java 11 free?
What are internal and external variables?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What will be the default values of all the elements of an array defined as an instance variable?
What is string builder?
What is the significance of continue jump statement? Explain with an example.
What is the static import?
Is 0 a real number?