根据list集合某个字段进行排序
2021-07-12 22:06
标签:his add 集合 string nbsp list for com over 根据list集合某个字段进行排序 标签:his add 集合 string nbsp list for com over 原文地址:https://www.cnblogs.com/zyf-yxm/p/9543855.htmlimport java.util.ArrayList;
import java.util.List;
class Student {
private String name;
private double age;
public Student(String name, double age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getAge() {
return age;
}
public void setAge(double age) {
this.age = age;
}
@Override
public String toString() {
return "Perosn [name=" + name + ", age=" + age + "]";
}
}
public class ListSort {
public static void main(String[] args) {
List