Skip to content
Sharp

Collections · interview question

When should you choose an ArrayList over an array in Java?

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

Correct answer

D. When you need dynamic resizing and easy element addition.

Why

ArrayList is preferable when you need a collection that can grow in size dynamically. Unlike arrays, ArrayLists can expand or shrink as elements are added or removed.

Test yourself on Collections

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

Start free test
All Collections questions →