Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. I. If we want a Collection that does not store duplicate values, then we use a Set based collection. II. If we want to frequently access elements operations based on an index value then we use a List based collection. E.g. ArrayList III. If we want to maintain the insertion order of elements in a collection then we use a List based collection. IV. For fast search operation based on a key, value pair, we use a HashMap based collection. V. If we want to maintain the elements in a sorted order, then we use a TreeSet based collection. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() a. Set b. List c. Map d. Any Collection implementation | ||||