Skip to content
Sharp

Modern Java · interview question

Which of the following is a potential misuse of Java records in domain modeling?

Multiple choiceMediumchapter-7-curatedpremiummodern-javacleaner-domain-modeling
Choose one answer
Answer and explanation

Correct answer

B. Using records for entities that require mutable state

Why

Java records are inherently immutable, making them unsuitable for use cases that require mutable state, such as entities that need to change over time.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →