I have the following class type declared.
In the QHT constructor, I want to allocate to "conf" an array of m Configs where each Config contains an array of n
Pieces. The value of n is not known at compile time. How can I do this in Java?
class Piece
{
public byte type;
public byte loc;
}
class Config
{
private Piece [] piece;
private int next;
private int parent;
public Config( int n ) {piece = new Piece[ n ];}
}
class QHT
{
private Config [] conf;
public QHT( int m, int n );
}
In the QHT constructor, I want to allocate to "conf" an array of m Configs where each Config contains an array of n
Pieces. The value of n is not known at compile time. How can I do this in Java?