title: Store interface in array list java
body: <p>I am learning java. I am trying to use composite design pattern. I am trying to use
  following logic. ( Don't laugh I know it is very basic :) )</p>
  
  <pre><code>Item -&gt; interface
  Folder -&gt; class
  File -&gt; class
  </code></pre>
  
  <p>In folder class, can I create an arraylist of Item to store files information?</p>
  
  <pre><code>ArrayList&lt;Item&gt; info = ArrayList&lt;Item&gt;();
  </code></pre>
  
  <p>Or should I use Folder Arraylist?</p>
  
  <pre><code>ArrayList&lt;Folder&gt; info = ArrayList&lt;Folder&gt;();
  </code></pre>
  
  <p>I don't know if interface can store real data as there is no variable just
  function definitions.</p>
  
  <p>Thanks for helping a newbie :)</p>