2. TreeSet存储自定义对象并遍历练习1(自然排序): (1)Student.java: 1packagecn.itcast_05;23/*4* 如果一个类的元素要想能够进行自然排序,就必须实现自然排序接口5*/6publicclassStudentimplementsComparable<Student>{7privateString name;8privateintage;910publicStudent() {11super();12}1314publicStudent(Strin...
1. TreeSet存储自定义对象并遍历练习2: (1)Student.java 1packagecn.itcast_06;23/*4* 如果一个类的元素要想能够进行自然排序,就必须实现自然排序接口5*/6publicclassStudentimplementsComparable<Student>{7privateString name;8privateintage;910publicStudent() {11super();12}1314publicStudent(String name,intag...