Styrow.dev
Question 152 of 247
Java Topic: General medium

What is the purpose of making an object immutable?

Question

What is the purpose of making an object immutable?

Answer

Since they cannot change state, they cannot be corrupted by thread interference or observed in an inconsistent state.