对象数组的增删查改实例
import java.util.*;
public class MyList1 extends ArrayList
{
String name;
int id;
double score;
public MyList1(String name, int id, double score)
{
this.name = name;
this.id = id ;
this.score = score;
}
public String toString()
{
return "姓名:"+name+" 学号: "+id+" 分数:"+score;
}
public static void main(String []args)
{
ArrayList<MyList1> mylist1=new ArrayList<MyList1>();
System.out.println();
mylist1.add(new MyList1("张三",15,2000));
mylist1.add(new MyList1("李四",18,3000));
mylist1.add(new MyList1("王五",16,2500));
mylist1.add(new MyList1("孙六",17,2100));
System.out