Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java: Using a primitive in an identifier?

Name: Anonymous 2006-04-07 16:55

Is it possible to use a primitave value in a reference object's name?
I'm trying to set up a loop to read a list of double values from a file, and make an object for each one.  Something like:

int objectnumber = 1;
Box box-objectnumber = new Box(br.readLine());
objectnumber++;

So that I get 40 Box objects named box1 through box40.  Any ideas?  If I need to, I can just write out a hundred lines of code, but that would look stupid.  And yes, I'm a noob.

Name: Anonymous 2010-09-21 13:21

Don't use Java.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List