Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    public static void main(String[] args) {
        Runnable badTask = () -> {
            throw new RuntimeException("Throwing exception  from  task execution...");
        };

        ExecutorService exec = Executors.newSingleThreadExecutor();
        exec.execute(badTask);
        exec.shutdown();
    }
}