I have a basic question on Java ArrayList.
When ArrayList is declared and initialized using the default constructor, memory space for 10 el
(oldSize * 3)/2 + 1
If you are using default constructor then initial size of ArrayList will be 10 else you can pass the initial size of array while creating the object of ArrayList.
Example: In case default constructor
List list = new ArrayList<>();
list.size()
Example: In case parameterized constructor
List list = new ArrayList<>(5);
list.size()