I've successfully created a 2D Arraylist but I still am having issues storing my values into the Arraylist. My error message is as follows, "cannot find symbol - method add(int,java.lang.String). I know its probably a simple fix but I couldn't find it online or anywhere in my textbook. And I also am wondering if there is a simpler way to create a 2D arraylist. Thanks.
Here is where I declare the 2D array:
ArrayList <ArrayList<String>> account = new ArrayList<ArrayList<String>>();
Here is my code:
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);