详细ArrayList方法请参考jdk http://tool.oschina.net/apidocs/apidoc?api=jdk_7u4
import java.util.ArrayList; /** * Created by lx on 2016/10/14. */ class Student{ int id; String name; public Student(int id, String name) { this.id = id; this.name = name; } } public class ArrayListTest { public static void main(String[] args) { //ArrayList声名 ArrayList<Student> stus=new ArrayList<Student>(); //add方法 stus.add(new Student(1,"Jack")); stus.add(new Student(2,"Amy")); //remove方法 stus.remove(0); //add另一个arraylist ArrayList<Student> superstars=new ArrayList<Student>(); superstars.add(new Student(888,"李刚的儿子")); stus.addAll(superstars); } }