"int cannot be dereferenced" java?

Sorry if this is a stupid question, im a novice

}

public void startGame() {

score = 0; crashes = 0; cars = 0;

//driver update score Callback pattern

compCars = new Car [maxCars];

//loop through the array create the individual cars

for (int i = 0; i < maxCars.length; i++) //ERROR ON THIS LINE

compCars[i] = new Car ();//random number 0-12 random number 0-3*/)

add(compCars[i],0);

}

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.