title: Type List vs type ArrayList in Java
body: <pre><code>(1) List&lt;?&gt; myList = new ArrayList&lt;?&gt;();
  
  (2) ArrayList&lt;?&gt; myList = new ArrayList&lt;?&gt;();
  </code></pre>
  
  <p>I understand that with (1), implementations of the <strong>List</strong> interface can be swapped.  It seems that (1) is typically used in an application regardless of need (myself I always use this).  </p>
  
  <p>I am wondering if anyone uses (2)?  </p>
  
  <p>Also, how often (and can I please get an example) does the situation actually require using (1) over (2) (i.e. where (2) wouldn't suffice..aside <strong><em>coding to interfaces</em></strong> and <strong><em>best practices</em></strong> etc.)</p>