Question 6 [9]
6.1 In what situations (in general) would you use a
TreeMap? (3)
6.2 In what situations (in general) would you use a HashSet
to store a collection of
values?
Answer / ashima
TeeMap is used when the data is to be stored in a sorted
order of the keys.
HashSet is used when it is not required to store the data
in the sroted order. Also, the insertion, deletion and
selection is faster in HashSet.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between abstract class and interface?
Which One is optimal to choose ? Syncronized hash map or Hash table with single thread model? How can a hash map syncronized with out using syncrozed blocks in programm?
What is the difference between notify and notifyall method?
Convert Binary tree to linked list.
What is a final class in java?
Name few java 8 annotations ?
What is the difference between int and integer in java?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
can we have function for truncating the sign as like abs in oracle.
How do you make an arraylist empty in java?
Is void a data type in java?
What are the new features in java 8? Explain