title: CompletableFuture<T> class: join() vs get()
body: <p>What is the difference between the <code>get()</code> and <code>join()</code> methods of the <code>CompletableFuture&lt;T&gt;</code> class?</p>
  <p>Below is the my code:</p>
  <pre><code>List&lt;String&gt; process() {
  
      List&lt;String&gt; messages = Arrays.asList(&quot;Msg1&quot;, &quot;Msg2&quot;, &quot;Msg3&quot;, &quot;Msg4&quot;, &quot;Msg5&quot;, &quot;Msg6&quot;, &quot;Msg7&quot;, &quot;Msg8&quot;, &quot;Msg9&quot;,
              &quot;Msg10&quot;, &quot;Msg11&quot;, &quot;Msg12&quot;);
      MessageService messageService = new MessageService();
      ExecutorService executor = Executors.newFixedThreadPool(4);
  
      List&lt;String&gt; mapResult = new ArrayList&lt;&gt;();
  
      CompletableFuture&lt;?&gt;[] fanoutRequestList = new CompletableFuture[messages.size()];
      int count = 0;
      for (String msg : messages) {
          CompletableFuture&lt;?&gt; future = CompletableFuture
                  .supplyAsync(() -&gt; messageService.sendNotification(msg), executor).exceptionally(ex -&gt; &quot;Error&quot;)
                  .thenAccept(mapResult::add);
  
          fanoutRequestList[count++] = future;
      }
  
      try {
          CompletableFuture.allOf(fanoutRequestList).get();
        //CompletableFuture.allOf(fanoutRequestList).join();
      } catch (InterruptedException | ExecutionException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      return mapResult.stream().filter(s -&gt; !s.equalsIgnoreCase(&quot;Error&quot;)).collect(Collectors.toList());
  }
  </code></pre>
  <p>I have tried with both methods but I see no difference in result.</p>