Interface List - java
<blockquote>
  <p><strong>Possible Duplicates:</strong><br>
  <a href="http://stackoverflow.com/questions/1413543/what-does-it-mean-to-program-to-a-interface">What does it mean to program to a interface?</a><br>
  <a href="http://stackoverflow.com/questions/5170893/interface-list-java">Interface List - java</a>  </p>
</blockquote>



<p>Hey there. I've been asked to use an the interface list in a couple of classes. My teacher says that this is to make it easier in the future to exchange an implementation. I've been asked to replace ArrayList by List wherever possible but am still not entirely sure what this means. I think I understand what an interface is but am not sure how to go ahead with the changes. </p>

<p>So for instance, this is the first part of one of the classes that I am supposed to modify all of the ArrayList bits with List. Any help is appreciated</p>

<pre><code>public class Simulator
 {
// Constants representing configuration information for the simulation.
// The default width for the grid.
private static final int DEFAULT_WIDTH = 70;
// The default depth of the grid.
private static final int DEFAULT_DEPTH = 40;

// List of animals in the field.
private ArrayList&lt;Animal&gt; animals;
</code></pre>
