private State USA = new State("United States of America");
private State CAN = new State("Canada");
private State MEX = new State("Mexico");
private State[] stateArray;
public static void main()
{
}
public void addState(State state) //I need a way to add the Private objects called State into an array here. The command must take User Interface
{
stateArray = stateArray.add(state);
}
要約すると、addState 配列に見られるように、配列に項目を追加できる何らかのメソッドが必要なだけです。