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... args) {
        Supplier<Person> personSupplier = Person::new;

        System.out.println(personSupplier.get());
    }
}

class Person {
    String firstName;
    String lastName;

    Person() {
    }

    Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }
}