[Beds] Java Question

Darren Parkinson darren.parkinson at gmail.com
Tue Dec 6 14:40:53 GMT 2005


Yeah, you're right -- the newer way seems to use maybe the ArrayList class
from the Collections Framework, which supports dynamic arrays.  It seems
that Vector is described as a Legacy class -- nice, feeling old now :)

On 12/6/05, David Pashley <david at davidpashley.com> wrote:
>
> On Dec 06, 2005 at 14:13, Stephen Elliott praised the llamas by saying:
> > Hi there,
> >
> >
> > I have a quick Java question I'd like to run past any Java Gurus out
> there.
> > I am writing a multi-thread chat server programming using RMI and want
> to
> > store all the
> > messages users send to each other in an array. The purpose being, when
> > someone new joins the chat room they will receive all previous messages
> > users have sent to one another. So far all I can do is store a
> predefined
> > amount e.g. 100. I have achieved this by creating a string array with
> 100
> > elements. What I would like to do is be able to store an infinite number
> of
> > messages but is it possible to create an array with an infinite number
> of
> > elements.
> >
> > I hope what I have said makes sense, this is as you've probably guessed
> an
> > assignment we have been given at University. I have asked my lecturer
> and he
> > says this is beyond the scope of the course but to me it seems foolhardy
> to
> > write a program that will crash once 100 messages have been relayed.
> >
> > Many Thanks
> > Steve...
>
> The answer is to use a container. Perhaps a List. You can create a List
> and then .append() items onto it.
>
> --
> David Pashley
> david at davidpashley.com
> Nihil curo de ista tua stulta superstitione.
>
> _______________________________________________
> Beds mailing list
> Beds at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/beds
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/beds/attachments/20051206/6d2f02c2/attachment.html


More information about the Beds mailing list