Skip to content
Hard Java Core

What is the output of: List<Integer> list = Arrays.asList(1, 2, 3); list.add(4);

— Tests your understanding of this concept.

Answer Options

A [1, 2, 3, 4]
B UnsupportedOperationException
C IndexOutOfBoundsException
D NullPointerException

Want to see the correct answer?

Get the answer with a detailed explanation, plus practice 20+ more Java Core questions with adaptive quizzes and timed interviews.

See the Answer on Guru Sishya →

This question is from the Java Core topic (Programming Languages).

More Java Core Questions