I'm working on a Java project for a Yahtzee game and need to create a parametrized constructor that gives both of my instance variables their values. My two instance variables are arrays.
public DiceArray(int[] die)
{
die = new int[5];
for( int i = 0; i < die.length; i++ )
{
die[i] = 0;
}
keep = new boolean[5];
for( int i = 0; i < keep.length; i++ )
{
keep[i] = false;
}
}
When I try to create the object in my application class with
// Testing parameterized constructor
DiceArray myDice = new DiceArray();
I get Exception in thread "main" java.lang.Error: Unresolved compilation problem: The constructor DiceArray() is undefined
When I take the parameter out of the method it works fine. Thanks in advance for any help