Hi,
I wanted to know how I can add data to an ArrayList if the collection is not: Private ArrayList<String> files;
and instead: Private ArrayList<People> files
. Would the code look like this:
public void addPerson(String name){
files.add(name);
}
or:
public void addPerson(String name) {
People people; // Declare an object
people = new People(name); // Create an object
files.add(people);
}