diff --git a/thread-pool/src/main/java/com/iluwatar/threadpool/App.java b/thread-pool/src/main/java/com/iluwatar/threadpool/App.java index a4c1887d3..9fe16d36a 100644 --- a/thread-pool/src/main/java/com/iluwatar/threadpool/App.java +++ b/thread-pool/src/main/java/com/iluwatar/threadpool/App.java @@ -81,13 +81,13 @@ public class App { // unbounded queue. At any point, at most nThreads threads will be active processing // tasks. If additional tasks are submitted when all threads are active, they will wait // in the queue until a thread is available. - ExecutorService executor = Executors.newFixedThreadPool(3); + var executor = Executors.newFixedThreadPool(3); // Allocate new worker for each task // The worker is executed when a thread becomes // available in the thread pool for (int i = 0; i < tasks.size(); i++) { - Runnable worker = new Worker(tasks.get(i)); + var worker = new Worker(tasks.get(i)); executor.execute(worker); } // All tasks were executed, now shutdown