title: How can I access a stack or linked list that's inside an ArrayList?
body: <p>So I'm trying to create "piles" of cards in a class called Table using an ArrayList with stacks inside of it that contain the card objects (which are defined in a separate class).</p>
  
  <p>I initialized it like so:</p>
  
  <pre><code>private MyArrayList&lt;MyStack&lt;Card&gt;&gt; piles;    
  
  public Table()
  {
    MyStack&lt;Card&gt; piles = new MyStack&lt;&gt;();
  }
  </code></pre>
  
  <p>My issue is that I can't figure out how to add things to and from the stack inside the ArrayList. Is my initialization of it wrong? If so, how can I fix it?</p>
  
  <p>Note: MyArrayList and MyStack are just slightly different versions of ArrayList and Stack essentially.</p>