Programming, Java, Lists, Data Structures.
DEFAULTCAPACITY_EMPTY_ELEMENTDATA) { return Math.max(10, minCapacity); } Next, when we have filled all the 10 positions and we are trying to add the 11th element, the size will be increased to 15. Here’s how: //Let's say current value of oldCapacity is 10 int oldCapacity = this.elementData.length;