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?



Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situ..

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

Post New Answer

More Core Java Interview Questions

What is “try and catch” in java

2 Answers  


What is the purpose of the system class in java programming?

0 Answers  


Explain what access modifiers can be used for variables?

0 Answers  


Nullpointer exception is a very common exception. Why is it not made as a checked exception?

2 Answers   Ness Technologies,


Why hashset is used in java?

0 Answers  






There are three interfaces A,B & C. A extends B, B extends C, and C extends A.Is it multiple Inheritance? please anybody help me.....

5 Answers  


What are the different types of inner classes?

0 Answers  


How to solve the problem of generating the unique hash keys with hash function?

0 Answers  


Does java have a compiler?

0 Answers  


what is the difference between future and callable interface in java?

0 Answers  


Can a class have multiple subclasses?

0 Answers  


when to for abstract class and when to go for interface

2 Answers  


Categories