Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {
        Runnable runnable = andThen(() -> System.out.print("Hello "), () -> System.out.print("World!"));
        new Thread(runnable).start();
    }

    static Runnable andThen(Runnable r1, Runnable r2) {
        return () -> {
            r1.run();
            r2.run();
        };
    }
}