Collection c2 = new ArrayList();
c2.add(new Student("张三",23));
c2.add(new Student("李四",24));
c2.add(new Student("王五",25));
c2.add(new Student("赵六",26));
c2.add(new Student("陈七",27));
Object[] arr = c2.toArray();
for (int i = 0; i < args.length; i++) {
Student s = (Student)arr[i];
System.out.println(s.getName()+" " +s.getAge());
}
}