I don't think you can dynamically name variables the way you are attempting
to name them.  I recommend putting the arrays in another array, or in an
ArrayList or Vector if you don't know how many you will need to store ahead
of time.

-----Original Message-----
From: Robert Jacobs [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 5:35 PM
To: JRun-Talk
Subject: Dynamic Naming for Array


I have a question for all of you java programmers out there.

Does anyone know how to dynamically name an object.

I wanted to create and array in a loop and name the array dynamically based
on the index value for the loop.

etc ......
for(i=0; i<=n;i++) {
Object[] obj_+dynamic value of i+ = new Object[SIZE];
}


Is that possible in Java or will have have to put the object arrays in the
position of another array?  Any help would be appreciated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/jrun-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to