Which type of ExecutorService supports the execution of tasks after a fixed delay?

Which type of ExecutorService supports the execution of tasks after a fixed delay?

Which type of ExecutorService supports the execution of tasks after a fixed delay?

A.
DelayedExecutorService

B.
ScheduledExecutorService

C.
TimedExecutorService

D.
FixedExecutorService

E.
FutureExecutorService

Explanation:

The ScheduledExecutorService interface supplements the methods of its parent ExecutorService
withschedule, which executes a Runnable or Callable task after a specified delay. In addition, the
interface definesscheduleAtFixedRate and scheduleWithFixedDelay, which executes specified
tasks repeatedly, at definedintervals.
Note:The java.util.concurrent package defines three executor interfaces:
*Executor, a simple interface that supports launching new tasks. *ExecutorService, a subinterface
of Executor,which adds features that help manage the lifecycle, both of the individual tasks and of
the executor itself.
*ScheduledExecutorService, a subinterface of ExecutorService, supports future and/or periodic
execution oftasks.
Reference: The Java Tutorials,Executor Interfaces



Leave a Reply 2

Your email address will not be published. Required fields are marked *


DonDorian

DonDorian

B – The ScheduledExecutorService interface supplements the methods of its parent ExecutorService with schedule, which executes a Runnable or Callable task after a specified delay. In addition, the interface defines scheduleAtFixedRate and scheduleWithFixedDelay