what is the difference between these 2 lines?
<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>



<pre><code>ArrayList&lt;Integer&gt; al = new ArrayList&lt;Integer&gt;();


List&lt;Integer&gt; l = new ArrayList&lt;Integer&gt;();
</code></pre>

<p>what is the difference between these 2 lines?  Is there any rules that I should use former one rather than later one in any case? Or vise versa? What is advantage or disadvantage of using particular one?</p>

<p>Thanks.</p>
