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 ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…