Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.concurrent.ExecutorService;

public class Main {
    public static void printStatus(Object o) {
        if (o instanceof Thread) {
            Thread t = (Thread) o;
            System.out.println("Thread " + t.getName() + " " + t.getState());
        } else if (o instanceof ExecutorService) {
            ExecutorService e = (ExecutorService) o;
            System.out.println("Executor " + e.isShutdown() + " " + e.isTerminated());
        }
    }
}