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 数组中所示