Java8ã«lambdaæ§æãå ¥ãã¾ããããããã¯ã¯ãã¼ã¸ã£ã¼ã§ã¯ãªããã¨ããã¦ãã¾ãã ã§ã¯ãã©ã®ããã«ãã¯ãã¼ã¸ã£ã¼ã§ã¯ãªããã®ããã¡ãã£ã¨è¦ã¦ã¿ã¾ãã ã¾ããlambdaãè¿ãã¡ã½ãããå®ç¾©ãã¾ãã public static Supplier<String> createMessenger(String name, String address){ return () -> { return String.format("ç§ã¯%sã%sã«ä½ãã§ã", name, address); }; } å¼ã³åºãã¨ããããªæãã§Supplierãåãåãã¾ãã Supplier<String> messenger = createMessenger("ããã ", "ãµããã"); ãã®Supplierãå®è¡ããã¨ã次ã®ããã«ãªãã¾ãã System.out.println(messenger.
{{#tags}}- {{label}}
{{/tags}}