Skip to content
Sharp

Modern Java · interview question

When should you avoid using Java Records?

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

Correct answer

A. When you need behavior methods beyond data storage.

Why

Java Records are designed for simple data storage and are not suited for scenarios where behavior methods are needed beyond basic data operations. In such cases, a traditional class would be more appropriate.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →