Sounds like you need a Vector object ( java.util.Vector )
Maarten van Leunen wrote:
> Howdie,
>
> Is there a way to expand arrays. Like, I want to put a unknown number of
> strings in an array.
>
> And then "return" the array of Strings in the Method.
>
> I read one string, and wish to add it to
>Is there a way to expand arrays. Like, I want to put a unknown number of
>strings in an array.
>
>And then "return" the array of Strings in the Method.
>
>I read one string, and wish to add it to the array without having to
>define the amount of Strings in the array previously.
>
Why don't you u
You probably want to use a Vector.
import java.util.Vector;
Vector vec = new Vector();
Then, to add an element, use:
vec.addElement(someString);
to retrieve an element, you can use:
String myString = (String)(vec.elementAt(index));
(you've got to cast the returned object into a String)
-Rob
On Tue, 08 Sep 1998 17:59:26 +0200, Maarten van Leunen wrote:
>Howdie,
>
>Is there a way to expand arrays. Like, I want to put a unknown number of
>strings in an array.
>
>And then "return" the array of Strings in the Method.
>
>I read one string, and wish to add it to the array without having to
On expanding arrays...
Maarten van Leunen wrote:
>
> Is there a way to expand arrays. Like, I want to put a unknown number of
> strings in an array.
>
> And then "return" the array of Strings in the Method.
>
> I read one string, and wish to add it to the array
On Tue, Sep 08, 1998 at 05:59:26, Maarten van Leunen said:
> Is there a way to expand arrays. Like, I want to put a unknown number of
> strings in an array.
>
> And then "return" the array of Strings in the Method.
>
> I read one string, and wish to add it to the array without having to
> define
Howdie,
Is there a way to expand arrays. Like, I want to put a unknown number of
strings in an array.
And then "return" the array of Strings in the Method.
I read one string, and wish to add it to the array without having to
define the amount of Strings in the array previously.
--
Maarten van