I’ve got a problem.. I’ve got something like…
if(condition(TEST) == true){
something (NAME) = new something(this);
}
This is inside a loop where there are many TEST variables being iterated through. I don’t know how many and its possible each of them would need a “(NAME)” variable so basically I want to know how would I make java “on the fly” generate a name for these variables?
Thanks!
Are you sure you don’t want to store the results in either an array or a collection?
The closest thing would be to use a
Map. Randomly generate aStringor anIntegerkey, and use it as a key to yourSomethingvalue.