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) {
        int x = 99;

        Consumer<Integer> myConsumer = (y) -> {
            System.out.println("x = " + x); // Statement A
            System.out.println("y = " + y);
        };

        myConsumer.accept(x);
    }
}