如何使用ArrayList获得其他名称形式?

问题描述 投票:-6回答:1
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);


}
java eclipse
1个回答
0
投票

在Arraylist中,我们使用get方法从Arraylist中获取内容,例如

© www.soinside.com 2019 - 2024. All rights reserved.