import java.util.ArrayList;
public class StudentCollection {
public static void main(String[] args) {
ArrayList<Student> student= new ArrayList<Student>();
Student s1 = new Student("Micheal","Nashville",1987);
Student s2 = new Student("Joshua","Tree",1990);
Student s3 = new Student("Zach","Martin", 2000);
Student s4 = new Student("Bob","Jackson",2008);
}
在Arraylist中,我们使用get方法从Arraylist中获取内容,例如