int getSpeed() {
int [] myArray = new int[3];
myArray[0] = car1;
myArray[1] = car2;
myArray[2] = car3;
for(int i = 1; i < myArray.length; i++)
return myArray[i];
}
When you are formatting your
getSpeed
method it looks like this...
It looks very wrong, and probably not what do you meant... your for loop is actually empty (as it returns on the first iteration)... It also starts with a nice 1 where you array indexed from zero...
You have to redesign it according the specification you set for yourself for this method...