3 ms·
A final variable must be assigned in the constructor, so it already meets all of those constraints.
by TheCoelacanth 11y ago
A final variable must be assigned in the constructor, so it already meets all of those constraints.
- TheLoneWolfling 11y agoI quote: > In particular with lazy-loading. Lazy loading != assigned in the constructor
- TheCoelacanth 11y agoYou can't lazy load a final variable. It has to be assigned in the constructor. If your point is that getting rid of null doesn't solve every single problem that exists, I agree. However, it in no way causes a degradation from the current status quo in nullable-by-default languages.