page banner
avatar
'Effectively Immutable Objects' post illustration
Effectively Immutable Objects

An immutable object is one whose state cannot be changed after construction. All the beauty in these objects is that they are simple and safe. In multi-threaded applications all concurrency issues boil down to coordinating access to mutable state. The less mutable state, the easier it is to ensure thread safety. That’s why you should always consider making your objects immutable whenever it is feasible. Creating an immutable type is not a complex process, but you should follow a handful of rules to stay away from pitfalls it definitely implies.

avatar
'Immutable Collections in Java' post illustration
Immutable Collections in Java

Occasionally, while programming, one may want to create constant sets and store them in final variables for public use. Such a desire can lead to all sorts of problems.