Skip to main content
2 of 13
added 86 characters in body

If immutable objects1 are good, simple, and offer benefits in concurrent programming why do programmers keep creating mutable objects2?

I have four years of experience in Java programming and as I see it, the first thing people do after creating a class is generate getters and setters in the IDE (thus making it mutable). Is there a lack of awareness or can we get away with using mutable objects in most scenarios?


  1. An immutable object is an object whose state cannot be modified after it is created.

  2. A mutable object is an object which can be modified after it is created.

  3. The original markdown.