int a = new int; //This allocates ten free slots proactively.
ArrayList<Integer> arl = new ArrayList<Integer>(10);
Your understanding is incorrect. If you create a
new ArrayList<Integer>(10), it will create an array of Integer of size 10 filled with nulls inside of the ArrayList as the nucleus of its data model. It will fill some or all of the slots depending on the number of items, and it will increase the size of the underlying array if the number of items exceeds its number of possible size. The
trimToSize() method has relevance.