Multiple choice technology programming languages

You need to create a class that will store unique object elements. You do not need to sort these elements but they must be unique. What interface might be most suitable to meet this need?

  1. Set

  2. List

  3. Map

  4. Vector

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

The Set interface is designed for collections that contain no duplicate elements. Implementations like HashSet enforce uniqueness without imposing any ordering requirement. Lists allow duplicate elements, Maps store key-value pairs, and Vector (a legacy List implementation) also permits duplicates.