 <p>The same behaviour as with <code>$.Deferred</code> in <code>jQuery</code> you can archive in <code>Java 8</code> with a class called <code>CompletableFuture</code>. This class provides the API for working with <code>Promises</code>. In order to create async code you can use one of it's <code>static</code> creational methods like <code>#runAsync</code>, <code>#supplyAsync</code>. Then applying some computation of results with <code>#thenApply</code>.</p>