Skip to content
Sharp

Core Java · interview question

Which method would you use to add an element to a List at a specific position?

Multiple choiceEasychapter-4-curatedpremiumcore-javacode-reading-with-collections
Choose one answer
Answer and explanation

Correct answer

A. Add(index, element)

Why

The add(index, element) method is used to insert an element at a specific position in a List.

Test yourself on Core Java

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

Start free test
All Core Java questions →