idea 类上定义注释

/**
 * @author yangquan
 */
public class DemoSupplier {
    public static void main(String[] args) {
        // String s = getString(() -> "helloworld");
        // String s = getString(() -> "helloworld");
        String s = getString(() -> "helloworld");
        System.out.println("s: " + s);
        Integer i = getString(() -> 123);
        System.out.println("i: " + i);
    }

    public static <T> T getString(Supplier<T> lambda) {
        return lambda.get();
    }
}

类似于这种
在这里插入图片描述
按照图示操作即可
在这里插入图片描述
这辈子坚持与不坚持都不可怕,怕的是独自走在坚持的道路上!!

猜你喜欢

转载自blog.csdn.net/taiguolaotu/article/details/113566650