This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Return object values from ArrayList

 
Lori Gardner-Wilson
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Rancher
Posts: 600
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I will try that.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if you are using Eclipse, get rid of those default "return null;"s
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic