我遇到了一个问题,我无法将值放入数组列表的某个位置。我有成功将字符串存储到变量中的用户输入,但我不知道如何将它们放入数组的特定单元格中。
代码:
public void newAccount() {
firstName = JOptionPane.showInputDialog("What's your first name?");
nLastName = JOptionPane.showInputDialog("What's your last name?");
nAddress = JOptionPane.showInputDialog("What's your current address?");
nCity= JOptionPane.showInputDialog("What's your current city?");
nState = JOptionPane.showInputDialog("What's your current State?");
nZipCode = JOptionPane.showInputDialog("What's your current Zip Code?");
account.add( accountNumber, firstName);
account.add( accountNumber, nLastName);
account.add( accountNumber, nAddress);
account.add( accountNumber, nCity);
account.add( accountNumber, nState);
account.add(accountNumber, nZipCode);
}