O'Reilly logo
  • MICHAEL MASLENKO thinks this is interesting:

This is required if you want to use such instances as keys in a HashMap or a similar container, because otherwise the container could get into an invalid state if the object used as a key was modified after it was added to the container. Immutable objects are also much easier to reason about, especially in multithreaded code


Cover of Kotlin in Action


immutable classes are good