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.


šŸ“² Practice Offline on Mobile: Download the free QA Automation & SDET Prep app on Google Play & App Store.