Java tutorial
import java.util.function.Supplier; public class Main { public static void main(String[] argv) { Supplier<Integer> supplier = () -> "java2s.com".length(); System.out.println(supplier.get()); Supplier<Integer> supplier1 = "java2s.com"::length; System.out.println(supplier1.get()); } }