nerdexam
Oracle

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…

Concurrency

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)
  • A
    4% (1)
  • B
    79% (19)
  • C
    13% (3)
  • E
    4% (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

#ScheduledExecutorService#ExecutorService#task scheduling#delayed execution

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice