TrainBeaser for iPhone
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Beginning Java
 
RSS feed
 
New topic
Author

Return object values from ArrayList

Lori Gardner-Wilson
Greenhorn

Joined: Jun 03, 2009
Messages: 11


Hello -

I am just starting to learn Java and am in a bit over my head.

I have an ArrayList (clientList) with Client objects.

How to I return the clientList with the attributes of the Client objects?

I've included code for the class that handles the serialization/deserialization and the testClass I'm using to return the data.

Test Code



Code for serializing/deserializing - not done with the lookupClient code yet....not sure how to do this exactly



Thanks a ton.
John de Michele
Ranch Hand

Joined: Mar 09, 2009
Messages: 510

Lori,

Welcome to JavaRanch!

It looks like you're using JUnit, and IIRC, JUnit tests are required to have a void return value. You may want to just use a normal Java class, so your methods can return ArrayList<Client> values.

John.
Lori Gardner-Wilson
Greenhorn

Joined: Jun 03, 2009
Messages: 11

Thanks I will try that.
Campbell Ritchie
Bartender

Joined: Oct 13, 2005
Messages: 14972

And if you are using Eclipse, get rid of those default "return null;"s
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Beginning Java
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench

.