What is the difference between `Executor`, `ExecutorService`, and `ScheduledExecutorService`?

Java Professional Medium

Java Professional — Medium

What is the difference between `Executor`, `ExecutorService`, and `ScheduledExecutorService`?

Key points

  • Executor has execute(); ExecutorService adds submit(), shutdown(), and Future support
  • ScheduledExecutorService includes schedule(), scheduleAtFixedRate(), and scheduleWithFixedDelay
  • Each interface serves a specific purpose in managing tasks in Java
  • Understanding the differences helps in choosing the right one for the task at hand

Ready to go further?

Related questions