Skip to content
Sharp

Object-oriented programming · interview question

Which of the following statements is true regarding immutability and thread safety in Java?

Multiple choiceHardchapter-3-curatedpremiumoopimmutability-basics
Choose one answer
Answer and explanation

Correct answer

D. Immutable objects are inherently thread-safe.

Why

Immutable objects are inherently thread-safe because their state cannot be changed after construction. This means that multiple threads can safely access them without the need for synchronization, avoiding issues related to concurrent modifications.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →