2 ms·
That use (and I haven't checked it - see my other post in this thread which I know works ( http://ideone.com/o1h0hR http://ideone.com/o1h0hR ) involves the boxi
by shagie 5y ago
That use (and I haven't checked it - see my other post in this thread which I know works ( http://ideone.com/o1h0hR http://ideone.com/o1h0hR ) involves the boxing of an int literal to an Integer.
In making it into a List<Integer>, it goes through boxing.
https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html https://docs.oracle.com/javase/tutorial/java/data/autoboxing...
The "half" means that this doesn't impact things like "int foo = 1 + 1" which will be 2 rather than 1,332. It's not because it's half of the uses of 1, but rather that some portion of the code will be converting int to Integer and that will impact those uses.