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 Posted / 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 |
Post New Answer View All Answers
what are the states associated in the thread? : Java thread
what happens when a thread cannot acquire a lock on an object? : Java thread
How to split arraylist elements in java?
java program with complete 4 oops concepts implemented example
What does it mean that a method or field is “static”?
What is the need of transient variables in Java ?
How does finally block differ from finalize() method?
What are the parts of methodology?
Write a program in java to establish a connection between client and server?
What is protected in java?
can rmi and corba based applications interact ?
Is java a prime method?
Can we overload the methods by making them static?
How to sort array of 0 and 1 in java?
Explain about automatic type conversion in java?