Re: Using arrays of objects ?




"TonyB" <tonyb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E9JDh.87996$tQ1.64679@xxxxxxxxxxxxxxxxxxxxxxxxx
I'm new to java, and would like some advice on how to keep track of groups
of objects where the number of objects is not predefined.
For example say I have a toolbox class which contains an arbitrary number
of
tool objects. I want to have a method to add a tool to the toolbox object,
and other methods to list the current contents of the toolbox for example.
I could keep a reference to each tool object as added in an array of type
tool but an array is declared with a fixed length, so short of defining
the
array to have a some arbitrary large size I can't see how to deal with
this
list of objects. I don't want to use a database at this time.
Is there a better way to do this ?
Tony

here we go
http://cs.gettysburg.edu/~cpresser/java/ForLoopTest.html

Joanna


.