If I create a class such as
public class record{
int index;
String name;
}
and then an ArrayList
ArrayList<.record> members = new ArrayList<.record>();
How do I add individual elements?
I thought there would be something like
members[x].index.add(someintegervalue);
members[x].name.add(somestringvalue);
and then a similar command to set new values if I wanted to change existing values.
Is there a simple way to do this?
Edit: This question has been answered, however it led to another problem. How to pass an ArrayList pointer to a function().
1 Answer