|
|
|
|
|
by ashishb
453 days ago
|
|
> Unless the object is immutable, like String, Integer, Long, ImmutableCollections, etc. Or your own immutable objects. Exactly.
You can have immutable primitives.
You can have immutable classes.
And you can combine them to form thread-safe immutable classes. |
|
It's much better to have immutable bindings/references so that nothing that mutates the object can be done through them. Rust does it very well, for example. Even C++ has a good version of this.