So I am trying to access the data members of an element in my ArrayList, but eclipse shows that the data member is not a field.
System.out.println(users.get(i).name);
users is an arrayList and the language is Java.
Thanks!
PS.
This is the definition of User
public class User {
public String name;
public String password;
}
I declare users like this:
ArrayList users;
users=new ArrayList<User>(NOOFUSERS);
Fixed the error!! Thank you!
users?