Hey folks,

today we’re going to look at the different ways in which you can write Asynchronous code in Java using the different API’s available.

We’re going to be covering:

  • Java 1 — Runnable’s
  • Java 5 — Executors and Futures
  • Java 8 — Completable Futures / Completion Stages

But before we get into it, let’s give ourselves a quick refresh of some definitions around sync / async and tasks.

Synchronous Programming:

  • The main thread executes each task before it moves onto the next

Simple to think and reason about, the steps in which you write your code will be executed…

Robert Finn

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store