Skip to content
Sharp

Modern Java · interview question

What would be a reason to choose a traditional class over a Java Record?

Multiple choiceMediumchapter-12-curatedpremiummodern-javajava-records
Choose one answer
Answer and explanation

Correct answer

B. Need for mutable state management

Why

If your use case requires mutable state, a traditional class is more appropriate since Java Records are inherently immutable.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →