title: Card Game in Java: Creating a "hand of cards"
body: <p>I would like to first say that this is not homework, but a pet project that I am working on in Java to better understand a complete Java program, and will hopefully be my first attempt at making my own GUI.</p>
  
  <p>That aside, I have a question about creating a hand of cards from my current code. As it stands, I have a main class called <code>DummyRummy</code>, a class for creating cards, a class that creates a standard deck of cards (which includes Jokers and "shuffles" the deck when a new deck is created), and a <code>PlayerHands</code> class. I am strictly working with <code>ArrayList</code>s for all of the code, and the <code>PlayersHands</code> class should return two <code>ArrayList</code>s that will be used. However, when I try to call the <code>PlayerHands()</code> method in the <code>public static void main()</code>, <code>PlayerHands</code> cannot be located for some reason... Here is the code for <code>PlayerHands</code>:</p>
  
  <pre><code>package dummyrummy;
  public class PlayerHands {
      private Card[] playerOneCards;
      private Card[] playerTwoCards;
      private int[] value;
  
      PlayerHands(deck d, int round)
      {
          value = new int[round+3];
          playerOneCards = new Card[round+2];
          playerTwoCards = new Card[round+2];
                 //(round+2) is the handsize at any given time
          for (int x=0; x&lt;round+3; x++)
          {
          playerOneCards[x] = d.drawFromDeck(); //fills up one hand.
          playerTwoCards[x] = d.drawFromDeck(); //fills up second hand.
          }
      }
  }
  </code></pre>
  
  <p>Here is the <code>DummyRummy</code> class.</p>
  
  <pre><code>package dummyrummy;
  import java.util.*;
  public class DummyRummy {
      public static void main(String[] args) {
          deck testDeck;
          testDeck = new deck();
  
          System.out.println(testDeck.getTotalCards());
          System.out.println(testDeck.getClass());
          int round = 1;
          PlayerHands(testDeck, round); //This is where the error is occurring        
          }//End of arguments
      }//End of DummyRummy class
  </code></pre>
  
  <p>Here is the <code>Card</code> class:</p>
  
  <pre><code>package dummyrummy;
  public class Card
  {
      private short rank, suit;
      private static String[] suits = { "Hearts", "Spades", "Diamonds", "Clubs", "Joker"    };
      private static String[] ranks = { "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King" };
      private static String[] jokers = {"Joker", "Joker"};
      private static String[] ranks2 = {"0", "0"};
      public static String rankAsString( int __rank ) {
          if (__rank != 0){
              return ranks[__rank];
          }//End of if statement
          return ranks2[__rank];
      }//End of rankAsString class
  
      Card(short suit, short rank)
      {
          this.rank=rank;
          this.suit=suit;    
      }//End of Card Initializer
  
      public @Override String toString()
      {
          if(suit == 5){
              return "Joker";
          }//End of if statement that calls jokers
          if(rank == 0){
              return "Joker";
          }
          return ranks[rank] + " of " + suits[suit];              
      }//End of toString method
  
      public short getRank() {
           return rank;
      }//End of getRank method
  
      public short getSuit() {
          return suit;
      }//End of getSuit method
  }//End of Card
  </code></pre>
  
  <p>And finally, here is the <code>deck()</code> class:</p>
  
  <pre><code>package dummyrummy;
  import java.util.Random;
  import java.util.ArrayList;
  
  public class deck {
      private ArrayList&lt;Card&gt; cards;
      deck()
      {
          cards = new ArrayList&lt;Card&gt;();
          int index_1, index_2;
          Random generator = new Random();
          Card temp;
  
         short jokerSuit=5;
         short jokerRank = 0;
             cards.add(new Card(jokerSuit, jokerRank));
             cards.add(new Card(jokerSuit,jokerRank));
          for (short suit=0; suit&lt;=3; suit++)
          {
               for (short rank=0; rank&lt;=12; rank++)
               {
                    cards.add(new Card(suit,rank));
               }
          }//End of for-loop       
          int deckSize = 54;             
          for (int i=0; i&lt;1000; i++)
          {
              index_1 = generator.nextInt( cards.size() );
              index_2 = generator.nextInt( cards.size() );
              temp = cards.get( index_2 );                    
              cards.set( index_2 , cards.get( index_1 ) );
              cards.set( index_1, temp );
          }//End of for-loop
      }//End of deck()
      public Card drawFromDeck()
      {
      /*
       * This method removes the top card of the already shuffled deck.          
       * The next step to take with this class is put the drawn card into another
       *     array that represents a players hand.  
       * This will take two arrays, and must be called depending on what player   'drawsFromDeck'.
       */        
          return cards.remove( 0 );
      }//End of drawFromDeck()
      public int getTotalCards()
      {
          return cards.size();   
      }//End of getTotalCards()
  }//End of class deck
  </code></pre>
  
  <p>Thank you for your time, and I appreciate any help that may come. I would also be more than happy to provide my other code, if necessary.</p>
  
  <p><strong>EDIT:</strong> I have added the class and package above.</p>