I have the following code:
public ArrayList[] username = new ArrayList[1];
public ArrayList[] password = new ArrayList[1];
public void save(String username, String password){
String uname = userField.getText();
String pword = passField.getText();
username.add(uname);
password.add(pword);
}
I am trying to make an ArrayList of usernames and passwords (using Window Builder) and add to it when someone wants to create a new user/pass. However I get an error saying "The method add(String) is undefined for the type String."
How do I fix and how do I make it so that the size of my array list can grow as new users are added?