title: What is the difference between List.of and Arrays.asList?
body: <p>Java 9 introduced new factory methods for lists, <a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html#of-E...-" rel="noreferrer"><code>List.of</code></a>:</p>
  
  <pre><code>List&lt;String&gt; strings = List.of("first", "second");
  </code></pre>
  
  <p>What's the difference between the previous and the new option? That is, what's the difference between this:</p>
  
  <pre><code>Arrays.asList(1, 2, 3);
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>List.of(1, 2, 3);
  </code></pre>