展开全部
附件是完整的eclipse/MyEclipse工程包,可32313133353236313431303231363533e59b9ee7ad9431333335326133以导入自行测试;
或许比别人的实现要长,主要是基于可扩展性的考虑。
// Entity Class
public class Student implements Comparable{
private int no;
private String name;
private int age;
public Student() {
// TODO Auto-generated constructor stub
}
public Student(int no, String name, int age) {
super();
this.no = no;
this.name = name;
this.age = age;
}
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {