引用构造器
新建类
package it.com.cc.fivetween;
public class StudentDemo {
public static void main(String[] args) {
// userStudentBuilder((String name,int age) ->{
// return new Student(name,age);
// });
userStudentBuilder((name, age) -> new Student(name,age));
userStudentBuilder(Student::new);
}
private static void userStudentBuilder(StudentBuilder sb){
Student s = sb.build("林青霞", 30);
System.out.println(s.getName()+","+s.getAge());
}
}
新建类
package it.com.cc.fivetween;
public class Student {
private String name;
private int age;
public Student() {
}
public Student(String name, int ag