Generic List initilaization to ArrayList
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4062982/list-versus-arraylist-as-reference-type">List versus ArrayList as reference type?</a>  </p>
</blockquote>



<p>I read somewhere in StackOverflow that this:</p>

<pre><code>List&lt;String&gt; foo = new ArrayList&lt;String&gt;();
</code></pre>

<p>is the best practice for initialization of ArrayList. And that this:</p>

<pre><code>ArrayList&lt;String&gt; foo = new ArrayList&lt;String&gt;();
</code></pre>

<p>should be avoided. Is this correct? If yes can someone explain why is it so?</p>

<p>Thanks,
EG</p>
