本帖最后由 魏-玉-彪 于 2012-7-28 19:34 编辑
for (int i = 0; i < 10; i++)
Test t = new Test();
等价于
Test t = new Test();
Test t = new Test();
Test t = new Test();
Test t = new Test();
Test t = new Test();
Test t = new Test();
Test t = new Test();
Test t = new Test();
Test t = new Test();
估计你的意思是
for (int i = 0; i < 10; i++)
Test ti = new Test();
这样就不是重复 Test t = new Test();了
而是等价于
Test t 1= new Test();
Test t2 = new Test();
Test t 3= new Test();
Test t 4= new Test();
Test t 5= new Test();
Test t 6= new Test();
Test t7 = new Test();
Test t8 = new Test();
Test t9= new Test();
|