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 :)<br>
<br>
<div><span class="gmail_quote">On 12/6/05, <b class="gmail_sendername">David Pashley</b> <<a href="mailto:david@davidpashley.com">david@davidpashley.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Dec 06, 2005 at 14:13, Stephen Elliott praised the llamas by saying:<br>> Hi there,<br>><br>><br>
> I have a quick Java question I'd like to run past any Java Gurus out there.<br>> I am writing a multi-thread chat server programming using RMI and want to<br>> store all the<br>> messages users send to each other in an array. The purpose being, when
<br>> someone new joins the chat room they will receive all previous messages<br>> users have sent to one another. So far all I can do is store a predefined<br>> amount e.g. 100. I have achieved this by creating a string array with 100
<br>> elements. What I would like to do is be able to store an infinite number of<br>> messages but is it possible to create an array with an infinite number of<br>> elements.<br>><br>> I hope what I have said makes sense, this is as you've probably guessed an
<br>> assignment we have been given at University. I have asked my lecturer and he<br>> says this is beyond the scope of the course but to me it seems foolhardy to<br>> write a program that will crash once 100 messages have been relayed.
<br>><br>> Many Thanks<br>> Steve...<br><br>The answer is to use a container. Perhaps a List. You can create a List<br>and then .append() items onto it.<br><br>--<br>David Pashley<br><a href="mailto:david@davidpashley.com">
david@davidpashley.com</a><br>Nihil curo de ista tua stulta superstitione.<br><br>_______________________________________________<br>Beds mailing list<br><a href="mailto:Beds@mailman.lug.org.uk">Beds@mailman.lug.org.uk</a>
<br><a href="http://mailman.lug.org.uk/mailman/listinfo/beds">http://mailman.lug.org.uk/mailman/listinfo/beds</a><br></blockquote></div><br>