Java – Mutable and Immutable Objects
This article shows you the difference between Mutable and Immutable objects in Java 1. Mutable object – You can change the states and fields after the object is created. For examples: StringBuilder, java.util.Date and etc. 2. Immutable object – You cannot change anything after the object is created. For examples: String, boxed primitive objects like …