If I am not mistaken, you should be getting an ArrayIndexOutOfBoundsException
for your modifyArray()
method. change the for loop in the method to
for (int counter=0; counter<b.length; counter++) // use < not <=
{
b[counter] *=2;
}