3 ms·
The correct solution is not having either. Getter/setters are effectively an anti pattern as they support needless mutability but worse they add nothing of valu
by xxs 3y ago
The correct solution is not having either. Getter/setters are effectively an anti pattern as they support needless mutability but worse they add nothing of value.
As a general rule most fields should be initialized in the c-tor, and they should be final.