今天学到了一个方法!分享给大家学习下!public static void main(String [] as){ Student a = new Student(a ); Student b = new Student(b ); Student c = new Student(c ); List<Student> list = new ArrayList<Student>(); listadd(a); listadd(b); listadd(c); Systemoutprintln(未修改前:); for(Student s: list){ Systemoutprintln(s); } asetMark(); listset( a); Systemoutprintln(已修改后:); for(Student s: list){ Systemoutprintln(s); } } } |