Add the following method to the ArrayIntList class from this chapter.
Write a method called removeFront that takes an integer n as a parameter and that removes the first n values from a list of integers. For example, if a variable called list stores [8, 17, 9, 24, 42, 3, 8] and a call of list.removeFront(4); is made, the list’s contents should become [42, 3, 8] . You may assume that the parameter value passed is between 0 and the size of the list inclusive.
public void removeFront(int n)
{
if(n < 0 || n > size)
return;
for(int i = 1; i <= n; i++)
{
for(int j = 0; j < size - 1; j++)
{
elementData[j] = elementData[j + 1];
}
size--;
}
}