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


Please Help Members By Posting Answers For Below Questions

What are thread priorities and importance of thread priorities in java?

626


What is a buffer in computer?

506


What is the diffrence between inner class and nested class?

558


What is the list interface?

606


How many types of methods are there in java?

525






What is the difference between the font and fontmetrics classes in java programming?

496


When should you make a function static?

539


Is intellij better than eclipse?

539


Why do we use predicate in java?

553


how to create daemon thread in java?

602


What is an infinite loop?

542


Can we able to pass objects as an arguments in java?

530


What do you mean by append?

530


Explain a situation where finally block will not be executed?

570


What does string intern() method do?

585