Java Lambda
借尸还魂Supplier函数package com.lius.jDemo; import com.lius.beans.student; import java.util.function.Supplier; /** * <p>T supplier()</p> * 1.get */ public class supplierTest { public static void main(String[] args) { //生成工厂 Supplier<student> studentFactory = student::new; //get工厂产生对象 System.out.println(studentFactory.get()); } }
版权声明:本文为qq_39663113原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。