Skip to content
Sharp

Modern Java · interview question

Which design choice best communicates intent for a lightweight data carrier without behavior in Java?

Multiple choiceMediumchapter-7-curatedpremiummodern-javamodern-java-design-choices
Choose one answer
Answer and explanation

Correct answer

B. Using a record

Why

Records are designed for immutable data carriers without additional behavior, making them ideal when you need a simple, concise way to model data.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →