Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.concurrent.TimeUnit;

public class Main {
    public static void runThreadUseLambda() {
        new Thread(() -> System.out.println("")).start();
    }

    public static void runThreadUseInnerClass() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("");
            }
        }).start();
    }

    public static void main(String[] args) throws InterruptedException {
        runThreadUseLambda();
        runThreadUseInnerClass();

        TimeUnit.SECONDS.sleep(1);
    }
}