How to Create an ArrayList of size N in Java?
The size we mentioned is just the initial capacity with which the ArrayList is created. But, it does not limit you from adding elements beyond the size N, and expand the ArrayList. Example – Create an ArrayList with Specific Size. In the following program, we will create an ArrayList of strings with size 3. Java Program
DA: 25 PA: 83 MOZ Rank: 14