这里新建一个UserInfo对象,用来测试lambda表达式排序,属性如下:
public class UserInfo { private int id; private int age; private String name; public UserInfo(int id, int age, String name) { this.id = id; this.age = age; this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getName() { return name; }测试 public void setName(String name) { this.name = name; }