1 以下代码主要利用jdk8中的lambda表达式, 和集合的stream()流
2 建立Person类和Student类,student继承Person
package demo;
public class Person {
private String name;
private Long pId;
public Person() {
}
public Person(String name, Long pId) {
this.name = name;
this.pId = pId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getpId() {
return pId;
}
public void setpId(Long pId) {
this.pId = pId;
}
}
package demo;
public class Student extends Person {
private String schoolName;
private Long sId;
public String getSchoolName() {
return schoolName;
}
publi