アイデアクラスに注釈を定義する

/**
 * @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