Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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