Add the following method to the ArrayIntList class from this chapter.
Write a method called fill that accepts an integer value as a parameter and replaces every value in the list with that value. For example, if a variable called list initially stores [42, –7, 3, 0, 15] and the call of list.fill(2); is made, the list will be changed to store [2, 2, 2, 2, 2] .
public void fill(int replacedValue)
{
for(int i = 0; i < size; i++)
{
elementData[i] = replacedValue;
}
}