Initialize your vector using a statement like

        Vector vNumbers = new Vector(0,1);

where 0 is the initial capacity, and 1 is the increment, i.e. the vector is
empty to begin with and each time an element is added the vector capacity
increases by one.

To put items into the vector one would use a statement like

        vNumbers.addElement(Object or String);

Elements in a vector are defined to be in Object form, so one would have to
convert numbers, whether integer or double or otherwise, to object form or
string form.  String form is compatible with object form in a vector, and
the vector does not complain.

Jim Mallmann


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Douglas
Sent: Tuesday, February 15, 2000 7:32 AM
To: [EMAIL PROTECTED]
Subject: Vector Constructor


I'm retreiving a list ("3,5,1,6") from a database and need to use the data
in a Vector. Can someone provide me with an example of getting this list
into a Vector? I'm not sure how the constructor works.

TIA

Jeff Douglas

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to