Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.function.Consumer;

public class Main {
    public static void main(String[] args) {
        processCustomer(12, (Customer c) -> System.out.println("Hello!"));
    }

    public static void processCustomer(int id, Consumer<Customer> makeCustomerHappy) {
        Customer c = Database.getCustomerWithId(id);
        makeCustomerHappy.accept(c);
    }
}

class Customer {
}

class Database {
    static Customer getCustomerWithId(int id) {
        return new Customer();
    }
}