title: How do I make my ArrayList add 52 unique objects instead of all the same?
body: <p>I've been stuck on this forever, but I think I've realized that my deck builder is ending up making a deck of cards all of the same, last value in the loop.</p>
  
  <p>Here is my code for the deck builder and a hand preparer. It includes an object Card which takes in two integers, here v and s. And an ArrayList of five cards to be dealt. I'd be grateful for some assistance!</p>
  
  <pre><code>public ArrayList buildDeck(){
      ArrayList&lt;Card&gt; newDeck = new ArrayList&lt;Card&gt;(52);     
      for(int v=0;v&lt;13;v++)
          for(int s=0;s&lt;4;s++) {
              Card nextCard = new Card(v,s);          
              newDeck.add(nextCard);
          }
      return newDeck;
  }
  
  public ArrayList fiveDeal() {
      ArrayList&lt;Card&gt; handOfFive = new ArrayList&lt;Card&gt;(0);
      for(int d=0;d&lt;5;d++)
      {
          handOfFive.add(cardDeck.get((gen.nextInt(cardDeck.size()))));
      }
      return handOfFive;
  }
  </code></pre>
  
  <p>and here is my Card class</p>
  
  <pre><code>public class Card
  {
      public static String value;
      public static String suit;
      public Card()
      {
          value="100";
          suit="Cards";
      }
      public Card(int v, int s)
      {
          if(v==0)
              value="Jack";
          if(v==1)
              value="Ace";
          if(v==11)
              value="Queen";
          if(v==12)
              value="King";
          else
              value = String.valueOf(v);
          if(s==0)
              suit="Clubs";
          if(s==1)
              suit="Spades";
          if(s==2)
              suit="Diamonds";
          else
              suit="Hearts";
      }
      public static String getCard(Object Card)
      {
          return value + " of " + suit;
      }
  }
  </code></pre>