title: How to create a hand class for BlackJack java
body: <p>Can someone please please help.  I have created a card class and Deck class but I just dont know how to create the Hand class.</p>
  
  <p>This is my Card class below.</p>
  
  <pre><code>package blackjack;
  
  public class Card {
    private int rank;
    private int suit;
  
    @Override
    public String tostring() {
      String result = "";
      if (rank == 1) result = "Ace";
      if (rank == 2) result = "Two";
      if (rank == 3) result = "Three";
      if (rank == 4) result = "Four";
      if (rank == 5) result = "Five";
      if (rank == 6) result = "Six";
      if (rank == 7) result = "Seven";
      if (rank == 8) result = "Eight";
      if (rank == 9) result = "Nine";
      if (rank == 10) result = "Ten";
      if (rank == 11) result = "Jack";
      if (rank == 12) result = "Queen";
      if (rank == 13) result = "King";
  
      if (suit == 1) result = result + " of Clubs ";
      if (suit == 2) result = result + " of Diamonds ";
      if (suit == 3) result = result + " of Hearts ";
      if (suit == 4) result = result + " of Spades ";
  
      return result;
    }
  
    public Card(int rank, int suit) {
          this.rank = rank;
          this.suit = suit;           
    }
  }
  </code></pre>
  
  <p>This is my Deck Class</p>
  
  <pre><code>package blackjack;    
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Random;
  
  public class Deck {
    private Random shuffles = new Random();
    public ArrayList&lt;Card&gt; Deck = new ArrayList&lt;Card&gt;();
    Random rand = new Random();
  
    // private int numberOfCards = 52;
  
    public Deck() {
      for (int ranks = 1; ranks &lt;= 13; ranks++) {
        for (int suits =1 ; suits &lt;= 4; suits++) {
           Deck.add(new Card(ranks, suits));
           //System.out.println(Deck.get(ranks) + "" +Deck.get(suits)); 
        }
      }
      shuffle();
  
      for (int i = 1; i &lt; Deck.size(); i++) {
        //int cardPosition2 = shuffles.nextInt(52); 
        //shuffle.nextInt(Deck.get(i);
        System.out.println(Deck.get(i)); 
        //System.out.println(cardPosition2);
        //i++;
      }
    }
  
    public void shuffle() {
      Collections.shuffle(Deck);
    }
  
    public Card DrawCard() {
      int cardPosition = shuffles.nextInt(Deck.size());
      return Deck.remove(cardPosition);
    }
  
    public int TotalCardsLeft() {
      return Deck.size();
    }
  
    public Card dealCard() {
      // Deals one card from the deck and returns it.
      if (Deck.size() == 52) {
        shuffle();
      }
      Card temp;
      temp = Deck.get(0);
      Deck.remove(0);
      return temp;
    }
  
    public Card getCard(int i) {
      return Deck.get(i);
    }
  
    public Card remove(int i) {
      Card remo = Deck.get(i);
      Deck.remove(i);
      return remo;
    } 
  }
  </code></pre>
  
  <p>If you can help me with my Hand call I would really appreciate it.</p>