i have question about this line(theData = theData1;) what is mean? i know we create anothor array called theData1 and copy the elements so the line what does it mean?
private void reallocate ()
{
capacity *= 2;
E[] theData1 = (E[]) new Object[capacity];
for (int i = 0; i < size; i++)
theData1[i] = theData[i];
theData = theData1;
}