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

question on Thread synchronization

3 Answers   Huawei,


What is boolean logic?

0 Answers  


How do you do exponents in java?

0 Answers  


What are identifiers in java?

0 Answers  


What is deadlock and how to avoid this?

2 Answers  






Which one of the following suits the description of a string better: derived or primitive?

0 Answers  


What are variable arguments or varargs?

0 Answers  


How to create packages in java?

0 Answers  


Write a java program to generate fibonacci series ?

0 Answers   Cyient,


What is passing by reference in java?

0 Answers  


if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...

10 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


Categories