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 are static blocks and static initalizers in java ?

0 Answers  


Is string a class in java?

0 Answers  


What is thread?

7 Answers   BMC, Virtusa,


How to count occurrences of each duplicate element in a list {a,b,d,c,a,b} ? Thanks in Advance

2 Answers   TCS,


In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?

5 Answers  






What is a variable declaration?

0 Answers  


Is java is a fully object object oriented language?

31 Answers   TCS,


Why generics are used in java?

0 Answers  


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

0 Answers  


List some java keywords sun like c, c + + keywords?

0 Answers  


What is type conversion in java?

0 Answers  


what really hapens when a object is created using new operator? 1.is it allocates memory to all variables and methods in the class with reference to that object?

3 Answers  


Categories