| ▲ | pron 3 hours ago | |||||||
That's not quite how it works in Valhalla. Because Integer and int already exists, your declarations above will be interpreted with those meanings, but (assuming some TBD nullability annotation), they will be equivalent to `int? x` and `Integer! x` respectively. In other words, the nullability of a variable is a separate concern from the data type, and other than the different defaults on variable declarations (as these types already exist), Integer and int become the same type. | ||||||||
| ▲ | tsimionescu 2 hours ago | parent | next [-] | |||||||
This may be true, hopefully, in a future version of Java, if the article isn't wrong. In JDK 28 with the Preview feature enabled, int is not nullable and Integer is nullable, and they are thus different types under the hood. Which also means that on most CPU architectures, Long[] will be just as inefficient compared to long[] as it was in any previous version of Java. | ||||||||
| ||||||||
| ▲ | 2 hours ago | parent | prev [-] | |||||||
| [deleted] | ||||||||