1Z0-804 · Question #144
Which type of ExecutorService supports the execution of tasks after a fixed delay?
The correct answer is B. ScheduledExecutorService. 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…
Question
Which type of ExecutorService supports the execution of tasks after a fixed delay?
Options
- ADelayedExecutorService
- BScheduledExecutorService
- CTimedExecutorService
- DFixedExecutorService
- EFutureExecutorService
How the community answered
(24 responses)- A4% (1)
- B79% (19)
- C13% (3)
- E4% (1)
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.
Topics
Community Discussion
No community discussion yet for this question.