package collection;
import java.util.*;
public class NewStudent implements Comparable<NewStudent>{
private int code;
private String name;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public char getSex() {
return sex;
}
public void setSex(char sex) {
this.sex = sex;
}
public NewStudent(int code, String name, char sex) {
this.code = code;
this.name = name;
this.sex = sex;
}
private char sex;
public NewStudent() {
super();
}
@Override
public String toString() {
return "NewStudent{" +
"code=" + code +
", name='
Java集合:List中存放若干学生对象(学生有学号,姓名,性别等属性),去除List中重复的元素,并按学号降序输出。
最新推荐文章于 2024-08-06 15:44:25 发布