Use ArrayList Constructor...
hi! I have been looking at the source code for the ArrayList class, and I found a constructor that allows you to make an ArrayList of a given length,
Code:
ArrayList test = new ArrayList(int length);
(source code for ArrayList class) Docjar: java/util/ArrayList.java
But whenever I try to use this constructor, a normal ArrayList is made, not the one with a length of 42 that I want.
So my question is: Does this constructor actually work?
I'd gladly use an array, but using an ArrayList is part of my assignment.
Thanks