/**
* @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
following the operation shown in the figure
. The one who is afraid is to walk on the road of persistence alone! !