Programming, Java, Lists, Data Structures.
is the same. If it is, then grow() method should be called. Let’s have look at grow() method. So grow() function is calling parametrized grow function by passing the size incremented by 1. Now, look at line 2, freaking Arrays.copyOf(). In our example code, we also created a new array with size+1