title: When to use LinkedList over ArrayList in Java?
body: <p>I've always been one to simply use:</p>
  <pre><code>List&lt;String&gt; names = new ArrayList&lt;&gt;();
  </code></pre>
  <p>I use the interface as the type name for <em>portability</em>, so that when I ask questions such as this, I can rework my code.</p>
  <p>When should <a href="https://docs.oracle.com/javase/9/docs/api/java/util/LinkedList.html" rel="noreferrer"><code>LinkedList</code></a> be used over <a href="https://docs.oracle.com/javase/9/docs/api/java/util/ArrayList.html" rel="noreferrer"><code>ArrayList</code></a> and vice-versa?</p>