Skip to content
Sharp

Modern Java · interview question

Which of the following statements is true about Java Records?

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

Correct answer

B. Fields in a record are final and cannot be changed after initialization

Why

Fields in Java Records are implicitly final, meaning they cannot be changed once the record is constructed. This immutability is a key feature of records.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →