|
-
April 7th, 2010, 07:15 AM
#1
How do i access methods from an arraylist?
At the moment i have an arraylist as so:
ArrayList<Client> clients = new ArrayList<Client>();
and I've filled this arraylist with the details of the clients themselves, including things like their name, address, salary, etc.
I can't seem to access the methods of the Client class from the ArrayList, all I end up with is an error when i try to do so. For example, I tried to access the address details of the first client in the arraylist as so:
clients.get(0).getAddress();
but this just gave me an error. Can someone please tell me what im doing wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|