Creating objects from classes that implement interfaces in Java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/147468/why-should-the-interface-for-a-java-class-be-prefered">Why should the interface for a Java class be prefered?</a>  </p>
</blockquote>



<p>In Java, is there a difference between these two lines? If so, what is it, and when should I use either one?  Is there a preferred convention?</p>

<p>Note that ArrayList implements List.</p>

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

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