title: Card c in video poker
body: <p>I'm working on a video poker assignment in java. We are given class templates that we are supposed to use in our program. I'm confused as to what <code>Card c</code> represents. Like in the method <code>addCard(Card c)</code>, does that just mean  it will be executed on the Card object that's currently in use? Here are the class files I've been working on so far. They are far from finished.</p>
  
  <p>Player Class:</p>
  
  <pre><code>import java.util.ArrayList;
  public class Player {
  
  
  private ArrayList&lt;Card&gt; hand; // the player's cards
  // you will likely need more instance variables
  
  public Player(){        
      ArrayList&lt;Card&gt; hand = new ArrayList;
  }
  
  public void addCard(Card c){
      // add the card c to the player's hand
  }
  
  public void removeCard(Card c){
      // remove the card c from the player's hand
  }
  
  // you will likely need more methods here
  }
  </code></pre>
  
  <p>Deck class:</p>
  
  <pre><code>import java.util.Random
  public class Deck {
  
  private Card[] theDeck; 
  private int top; 
  // add more instance variables if needed
  
  public Deck(){
      top = 0
      Card[] theDeck = new Card[52];
      for(int s = 1; s &lt;= 4; s++)
      {
      for (int v = 1; v &lt;= 13; v++)
      {
          for (int i = 0; i &lt; theDeck.length; i++)
              theDeck[i] = new Card(s,v);
  }
  
  public void shuffle()
  {
      // shuffle the deck here
      Random generator = new Random();
      int i;
      int j;
      int temp = i;
      int i = generator.nextInt(51) + 1;
      int j = generator.nextInt(51) + 1;
      for(int k = 1; k &lt;100; k++)
      {
          theDeck[i] = theDeck[j];
          theDeck[j] = temp;
      }
      top = 0;
  }
  
  public Card deal(){
      // deal the top card in the deck
      if (top &lt; 40)
      {   
          theDeck.shuffle;
      }
      return theDeck[top];
      top++;
  }   //this method should add cards to array hand? no addCard will do that.
  
  
  
  
  
  // add more methods here if needed
  //DB getter methods here?
  
  }
  </code></pre>
  
  <p>Card Class: </p>
  
  <pre><code>public class Card implements Comparable&lt;Card&gt;{
  
  private int suit; 
  private int value; 
  
  public Card(int s, int v){ //constructor of an object Card
      s = suit;
      v = value;
      //make a card with suit s and value v
  }
  
  public int compareTo(Card c){
      // use this method to compare cards so they 
      // may be easily sorted
  
  }
  
  public String toString() //to tell the user what card/s they have
  {
      myCard.getSuit();
      myCard.getValue();
      if(s == 1)
      {
          if(v == 11)
          {
              return "Jack of Clubs";
          }
          if(v == 12)
          {
              return "Queen of Clubs";
          }
          if(v == 13)
          {
              return "King of Clubs";
          }
          if(v == 1)
          {
              return "Ace of Clubs";
          }
          else{
              return v + " of Clubs";
          }   
      }
      if(s == 2)
      {
          return v + "Diamonds";
      }
      if(s == 3)
      }
          return v + "Hearts";
      }
      if(s == 4)
      }
          return v + "Spades";
      }
  
  
  //DB method to set 1, 2, 3, and 4 to card suits
  
  
  //now here create string representation for the Card    
      // use this method to easily print a Card object
  
  public int getSuit()
  {
      return s;
  }
  public int getValue()
  {
      return v;
  }   
  
  //DB right now have cards in theDeck like Card(2, 10), need Card(d, 10)
  //need to convert that to a String d10 
  }
  // add some more methods here if needed
  
  }
  </code></pre>