Skip to content
Sharp

Collections · interview question

Which method would you use to remove an element from an ArrayList by its value?

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

Correct answer

C. Remove(Object o)

Why

The remove(Object o) method is used to remove the first occurrence of the specified element from the list, if it is present.

Test yourself on Collections

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

Start free test
All Collections questions →