package ThreadTest.Day3;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class Test08 {
public static void main(String[] args) {
ExecutorService executorService = Executors.newFixedThreadPool(10);
executorService.execute(new Mythread());
executorService.execute(new Mythread());
executorService.execute(new Mythread());
Future<?> submit = executorService.submit(new Mythread());
executorService.shutdown();
}
}
class Mythread implements Runnable{
@Override
public void run() {
System.out.println(Thread.currentThread().getName());
}
}