2 ms·
> Another confusion I have is that if primitive int and Integer merge into Int, then we have problems with null? The author isn’t suggesting that this would be
by chrisseaton 7y ago
> Another confusion I have is that if primitive int and Integer merge into Int, then we have problems with null?
The author isn’t suggesting that this would be a design change that would be compatible with the current semantics of Java, so behaviour for null would change.
- willvarfar 7y agoYeap. I can think of two main uses for Integer: when you have type polymorphism (e.g. my own code often has maps of Object) or nullness. I go on to describe a different approach to nullness that suites ints, for example.