Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create n Arrays whitout declaring them???

Status
Not open for further replies.

HoMyGod

Programmer
Jul 17, 2000
59
CH
Hi,

I have the following array :
anArray = Array("hi1", "hi2", "hi3",...)

and I would like to use it like this:

while(aResultSet.next())
{
while(i<choosedFieldSize)
{
hi1.add(aResultSet.getString(anArray.at(i))
}

hi1 is an array &quot;self created&quot;. I mean, that I don't know what's the size of anArray. But hi1, hi2, hi3,... must be Array's that I won't instanciate staticaly...

Is it possible and how can I do it?

Thank you very much
H.
 
Hi,

There are at least two options:

java.util.ArrayList
java.util.Vector

Rgds
Holger
 
Hey man,.


I know that you can't redim the arrays because that used to be big time security issues in C. Just set them at the class level. You're better off using a vector for this one though my man..

Anyway, come to think abou it that probably didn't even help, Take it easy,

Croag

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top