3 ms·
you misunderstand both Java generics and Java primitive types. 1. the JVM does not support generics as a language construct, and are simply a compiler feature
by languageserver 4y ago
you misunderstand both Java generics and Java primitive types.
1. the JVM does not support generics as a language construct, and are simply a compiler feature of Java
2. the JVM and Java differentiates primitive and reference types, Integer being a reference (boxing) type of the primitive type int. And, generics do not support primitive types anyway.
The JVM implementations are incredible pieces of machinery, and even if they did not pack or stride their primitive arrays -- which they absolutely do -- the JVM & compilers will handle an incredible amount of runtime memory layout and packaging.