Mastering Java 2026 – 400 Free Practice Questions to Pass the 'Thinking in Java' Exam

Get more with Examzify Plus

Remove ads, unlock favorites, save progress, and access premium tools across devices.

FavoritesSave progressAd-free
From $9.99Learn more

1 / 510

Which collection class allows duplicate elements?

Set

List

A Set does not allow duplicate elements since it adheres to the "unique keys" concept.

C: Queue does not allow duplicate elements since it follows a FIFO (First-In-First-Out) structure.

D: Map can have duplicate values, but not duplicate keys.

B: List is the correct answer because it allows for duplicate elements. This is because list data structures do not have any restrictions on the number of times an element can appear. Therefore, you can have duplicate elements in a list.

Get further explanation with Examzify DeepDiveBeta

Queue

Map

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy