Multiple choice technology architecture

Which of the following statements are true?

  1. At the root of the collection hierarchy is a class called Collection

  2. The collection interface contains a method called enumerator

  3. The interator method returns an instance of the Vector class

  4. The Set interface is designed for unique elements

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The Set interface is indeed designed to store unique elements - no duplicate elements are allowed. This is its defining characteristic. Option A is false because Collection is an interface, not a class. Option B is false because the Collection interface doesn't have an 'enumerator' method - it has an 'iterator' method. Option C is false because the iterator() method returns an Iterator, not a Vector instance - Vector is a concrete class that implements List.