Search⌘ K
AI Features

Quiz: Collections Framework

Test your understanding of the Java Collections Framework, including core interfaces, specific implementations, iteration strategies, and selection criteria.

We'll cover the following...
Technical Quiz
1.

Which statements accurately explains why we write List<String> list = new ArrayList<>(); instead of List<String> list = new List<>();?

A.

List is an older, deprecated class that has been fully replaced by the more modern ArrayList class in recent Java versions.

B.

ArrayList is a specialized version of List that runs significantly faster because it bypasses the Java Collections Framework hierarchy.

C.

List is an interface that acts as a contract and cannot be instantiated directly; we must use a concrete implementation like ArrayList.

D.

List does not support generic syntax like <String>, so the compiler forces us to use ArrayList on the right side of the assignment.


1 / 10
...