This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ThreadPool { | |
private static class DoSomething implements Runnable { | |
private int taskId; | |
public DoSomething(int taskId) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
public class JavaMultithreading { | |
private static class DoSomething implements Runnable { | |
@Override | |
public void run() { | |
System.out.println("\n Thread is executing " + Thread.currentThread().getName()); |