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.