diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/delay/Delay.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/delay/Delay.java index 36b7ed7ffb..0cc0c9487f 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/delay/Delay.java +++ b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/delay/Delay.java @@ -57,7 +57,7 @@ public class Delay { private static void delayedServiceTask(Integer delayInSeconds) { - final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); executorService.schedule(Delay::someTask1, delayInSeconds, TimeUnit.SECONDS); @@ -65,7 +65,7 @@ public class Delay { private static void fixedRateServiceTask(Integer delayInSeconds) { - final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); ScheduledFuture sf = executorService.scheduleAtFixedRate(Delay::someTask2, 0, delayInSeconds, TimeUnit.SECONDS);