Skip to content
Sharp

Collections · interview question

Which of the following correctly describes the behavior of the List interface in Java?

Multiple choiceEasychapter-4-curatedpremiumcollectionslist-interface-and-arraylist
Choose one answer
Answer and explanation

Correct answer

A. Lists can contain duplicate elements and maintain the order of insertion.

Why

The List interface in Java is an ordered collection that allows duplicate elements. It maintains the order of insertion, which means elements can be accessed in the order they were added. Unlike sets, lists can have duplicate elements and null values.

Test yourself on Collections

A free test with instant, explained results. No account needed.

Start free test
All Collections questions →