P
psmith
I have to declare a private instance variable, that can reference an
array of integers(3 of them).
I then need to take a suitable argument as an array, and then
initialise it to the private variable.
I have put
private int[] controlGroups;
public Nim()
{
this.controlGroups = new int[3];
}
Then when I run my code:
int[] counters = {7, 9, 11};
Nim aGame;
aGame = new Nim(counters);
I get this message:
Semantic error: line 3. Constructor error: Can't find constructor:
Nim( [I ) in class: Nim
Thanks in advance
array of integers(3 of them).
I then need to take a suitable argument as an array, and then
initialise it to the private variable.
I have put
private int[] controlGroups;
public Nim()
{
this.controlGroups = new int[3];
}
Then when I run my code:
int[] counters = {7, 9, 11};
Nim aGame;
aGame = new Nim(counters);
I get this message:
Semantic error: line 3. Constructor error: Can't find constructor:
Nim( [I ) in class: Nim
Thanks in advance