What is the best way to do the following:
List<MyObject> list = new LinkedList<MyObject>();
for(int i=0; i<30;i++)
{
MyObject o1 = new MyObject();
list.add(o1);
}
But the things is I don't wanna create objects with same name, I wanna create them with different name like o1,o2,o3,o4,o5,o6,o7,o8,o9,o10 and I wanna add each to the list. What is the best way to do this ?