Define annotations on the idea class

/**
 * @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();
    }
}

It’s not scary to persist or not to persist in this life like this by
Insert picture description here
following the operation shown in the figure
Insert picture description here
. The one who is afraid is to walk on the road of persistence alone! !

Guess you like

Origin blog.csdn.net/taiguolaotu/article/details/113566650