title: Populate stack with deck of cards Java
body: <p>I am currently designing a java application that will perform many different operations on a shuffled deck of cards. Within the application I have:</p>
  
  <ul>
  <li><em>Stack.java:</em>   This is the interface for the program, including methods like pop,push, peek</li>
  <li><em>Deck.java:</em>    My deck class, which implements stack</li>
  <li><em>Card.java:</em>    Card object class</li>
  <li><em>Shuffle.java:</em> Contains the code to perform the riffle shuffle on the card</li>
  <li><em>CardForce.java:</em> Main class</li>
  </ul>
  
  <p>The cards within my program can be described as having a <code>face(A,2,3,4..J,K,Q)</code> a <code>suit(Hearts,Diamonds,Clubs,Spades)</code> and a value which corresponds to the face i.e<br> <code>A = 1, 2 = 2, 3 = 3</code> and so on.</p>
  
  <pre><code>public Card(String cardFace, String cardSuit, int cardValue){
      face = cardFace;
      suit = cardSuit;
      value = cardValue;
  }//ends Card
  </code></pre>
  
  <p>Currently I have my cards stored within an ArrayList within my deck class.</p>
  
  <pre><code>public class Deck implements Stack{
  
  
  private List&lt;Card&gt; cards;
  
  private int size;//number of cards in deck
  
  
  public Deck(String[] faces, String[] suits, int[] values){
     cards = new ArrayList&lt;Card&gt;();
     for(String suit: suits) 
         for(int value = 0; value &lt; values.length &amp;&amp; value &lt; faces.length; value++){
             Card a = new Card(faces[value], suit, values[value]);
             cards.add(a);
         }
     size = cards.size();
     //////////////////////////////////////shuffle();
     shuffle();
  }//ends deck
  </code></pre>
  
  <p>I am looking to change my deck of cards from an arraylist to a stack, so I can perform the operations like pop, push &amp; peek. Any help on how to implement those operations after the list has been converted to a stack is also welcome. </p>