Skip to content
Sharp

Modern Java · interview question

Which characteristic of a value object ensures its immutability?

Multiple choiceMediumchapter-7-curatedpremiummodern-javavalue-objects
Choose one answer
Answer and explanation

Correct answer

A. Use of final fields

Why

Value objects achieve immutability by declaring fields as final, ensuring they cannot be changed once initialized. This provides thread safety and consistency across the application.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →