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.
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.