consecutive objects(please very fast)

I have a loop that must create objects and give it consecutive names like:

Obj0, Obj1, Obj2, etc...

I tried Object ("Obj" + i) =new Object();

wherei is the loop counter but it failed, I haven't got the least clue how to do it so please help me because I am on a very tight deadline schedule. Any creative ideas are welcomed

thanks, mikito

[455 byte] By [bronze-starDukes] at [2007-11-26 12:13:48]
# 1
You need to create an array.Object[] objects = new Object[YOUR_LENGTH_HERE];Im not too late am I?
goldstar at 2007-7-7 14:15:32 > top of Java-index,Archived Forums,Socket Programming...
# 2
You could also use a Map. Key would be those names, Value would be the object reference:Map myMap = new HashMap();myMap.put("Obj"+i, new Object());
silverstar at 2007-7-7 14:15:32 > top of Java-index,Archived Forums,Socket Programming...
# 3
I know arrays but arrays will not solve the problem because I need different objects not a single one, and btw that was REALLY fast, thanx anyway CapatinMorgan08mikito
bronzestar at 2007-7-7 14:15:32 > top of Java-index,Archived Forums,Socket Programming...
# 4
> I know arrays but arrays will not solve the problem> because I need different objects not a single one,They are different objects. You can use doremifasollatido's idea too.
goldstar at 2007-7-7 14:15:32 > top of Java-index,Archived Forums,Socket Programming...