Is ArrayList<Integer> optimized by the JDK to perform like int[]?
<p>We're taught that Java's ArrayList is less efficient for integers, because the list actually contains pointers, while an array of ints contains the integers in place, thus avoiding memory allocations and access.</p>

<p>My question is whether the JDK/JIT compiler optimizes this kind of inefficiency away? It has all the information to conclude these implementations are functionally equivalent , so it might as well replace ArrayList with an int[]-backed implementation under the hood.</p>
