2 ms·
i guess interior mutability just a design decision - it's not a _sham_, it works as intended. i'd like to know the reasons for this.
by stefs 4y ago
i guess interior mutability just a design decision - it's not a _sham_, it works as intended. i'd like to know the reasons for this.
- kaba0 4y agoI’m not sure this is the reason, but OOP is supposed to handle encapsulation of state. For example lazy initialization of an object can be done by proper encapsulation and interior mutability, while the outside view can be completely immutable.
- imtringued 4y agoBecause that is how final works in Java.