asked 823 views
1 vote
Collections are more elaborate data structures that allow you to store other objects. Unlike array, collections have a set of interfaces that makes it possible to manipulate the elements of a collection without you worrying about how the structure was created. Check the correct alternative about Collections, their interfaces and their classes in Java

asked
User Sarathkm
by
7.2k points

1 Answer

2 votes

As Collections in java offer data structures that simplify the manipulation of elements, allowing object storage. The correct alternative (alternative 1) highlights the difference between interfaces set and list Regarding the possibility of duplicate elements. Strong> List These are two data structures in Java collections with fundamental differences:

Step:

Stores unique elements, does not allow duplicates. (does not guarantee the insertion order).

Common implementations include hash set and treeset .

It is useful when you need guarantee Duplicates in a collection.

List:

Allows duplicate elements, ie it can contain equal elements < /strong>.

Main the order of insertion of elements.

Common implementations include array list , linkedlist and vector.

< P>

It is useful when you need a sequence ordered elements and can have duplicates.

answered
User Amquack
by
8.3k points