ExecutorService executor = Executors.newSingleThreadExecutor();
ExecutorService executor = Executors.newFixedThreadPool(5);
ScheduledExecutorService executor = Executors.newScheduledThreadPool(2); executor.scheduleAtFixedRate(task, initialDelay, period, TimeUnit.SECONDS);This creates an ExecutorService with a scheduled pool of 2 threads that will execute a task at a fixed rate, with an initial delay of `initialDelay` and a period of `period` in seconds. Package Library: java.util.concurrent is a core Java package library included in the Java SE (Standard Edition) version.