This post has been wikified, any user with enough reputation can edit it.
How do I get string from a list using get? (Java)
So I'm using a class user for an auto-growing array.
public static List<User> users = new ArrayList();
And then adding value to it in a function like this:
(This is in a different class)
Main.users.add(new User(username, password));
Then I try to extract the data like so:
System.out.println(Main.users.get(0));
But this is the result
users.main.User@55f96302
Any ideas on how to fix this? Thanks.
Comment
Should you not have some method in your User class that returns a string or something ? Because obviously this will give you the id of that particular object which is being returned.
So tell me Can you access the main and user class ??