I need to create an array of objects (Cars) and then initialise the array to be of a required size (10) within a constructor. So far I have this:
public class Queue {
private Car [] car;
public Queue (Car [] car) {
Car [] car = new Car[10];
}
}
Which when I compile says it cannot find the Car symbol. I'm presuming the problem is with the creation of the array as I don't seem to have created the Car properly. Any help would be appreciated <3
Cardefined ?carvariable three times: once as a field, once as a parameter to the constructor, and once as a local variable in the constructor. None of them are actually used.