标题: list [打印本页] 作者: wanjia921011 时间: 2015-9-28 17:57 标题: list public static void main(String[] args) {
List l = new ArrayList();
l.add(new Test_Student("古力娜扎",18));
l.add(new Test_Student("孙俪",18));
l.add(new Test_Student("朱茵",18));
for (int i = 0; i < l.size(); i++) {
Test_Student s = (Test_Student)l.get(i);
System.out.println(s.getName() + "......" + s.getAge());
}
}