时空中的沙粒
2016-02-03 14:37
courseToSelect =new ArrayList();容器都是用的ArrayList。
为什么Set方法中如果使用了get方法或者按顺序输入了课程;Set类就变成了有序,Set是定义在student类里面的this.courses =new HashSet();?
student类的构造方法中初始化定义了
public class Student {
public String id;
public String name;
public Set<Course> courses;
public Student(String id,String name){
this.id=id;
this.name=name;
this.courses=new HashSet<Course>();
}
}Java入门第三季
409775 学习 · 4546 问题
相似问题