Results 1 to 1 of 1
  1. #1
    cjgarcia is offline Member
    Join Date
    Apr 2012
    Rep Power

    Default players hand class. Need help!

    So I need to make a void addCardToHand(c) class that adds the paramenter card to the hand. I'm not sure how to do this and I'm drawing a blank. This class is tied in with the Card and Deck class that I have already created. This is what I have so far.

    Java Code:
    import java.util.*;
         public class Player {
    	private String player = "";
    	private String player2 = "";
    	private Card[] hand = new Card[52];
    	//defult constructer
    	public Player ( String playerName) {
    		this.player = playerName;
    		this.hand = new Card[52];
    	//adds a card to the hand
    	public void addCardToHand( Card c ) {
    Last edited by cjgarcia; 04-26-2012 at 12:49 AM.

Similar Threads

  1. Java HangMan - Alternate between players
    By JohnyQ in forum Networking
    Replies: 1
    Last Post: 11-22-2011, 02:45 AM
  2. Need help for my application: Stroke Class & Free hand drawings
    By JavaIsChallenging in forum AWT / Swing
    Replies: 0
    Last Post: 09-23-2011, 06:17 PM
  3. Alternating between players moves in a game
    By nephos in forum New To Java
    Replies: 3
    Last Post: 04-18-2011, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts