You could also use java.util.ArrayList if you are wanting to return an array
from a method and don't know how many items you will get from the method.

Create an arraylist:
ArrayList tcList = new ArrayList();

Add stuff to it:
tcList.add(object_or_variable);

Pass it back, casting it to an array:
return (Test[])tcList.toArray(new Test[0]);


Dale Nicholson

> -----Original Message-----
> From: Christian Kurze [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 6:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Dynamic arrays
>
>
> use java.util.Vector instead of arrays
>
> Christian
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Panayiotis Periorellis
> Sent: Wednesday, February 20, 2002 1:01 PM
> To: [EMAIL PROTECTED]
> Subject: Dynamic arrays
>
>
> Can someone inform me how do we declare dynamic arrays?
>
> Thanks
> panos
>
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to