Skip to content
Sharp

Core Java · interview question

Which scenario could lead to unexpected behavior due to autoboxing when summing elements in a List<Integer>?

Multiple choiceHardchapter-7-curatedpremiumcore-javawrapper-types-and-autoboxing
Choose one answer
Answer and explanation

Correct answer

A. Using a parallel stream to sum elements

Why

Using a parallel stream may result in multiple autoboxing and unboxing operations, which could lead to performance issues or unexpected behavior if not carefully managed.

Test yourself on Core Java

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

Start free test
All Core Java questions →