title: Print out all elements of a stack/queue
body: <p>I am trying to go through a stack and a queue and print out the Object's values. In my Object's class I have implemented a toString. My stack and queue classes use a linked list. I tried going through it with a for loop like an array first, obviously doesn't work. I know how to get the top but not all of them.</p>
  
  <pre><code>for (i = 0; i &lt;= 9; i++) {
  System.out.println(storageA[i].toString());
  }
  </code></pre>
  
  <p>storageA is my stack with fixed size of 10.</p>