list.add(new Student(23, "搜狐张朝阳"));
list.add(new Student(24, "360周鸿祎"));
int size = list.size();//在此现将list长度取出固定就好
for (int i = 0; i <size; i++)//size大小固定,不会进入下次循环
{
Student s = (Student) list.get(i);
if ("360周鸿祎".equals(s.getName()))
{
list.add(2, new Student(30, "Tecent马化腾"));
list.set(3, new Student(31, "Tecent"));
}
System.out.println("学生姓名:"+s.getName()+" ; 学生年龄:"+s.getAge());
}