Arrays-Poker Simulation Methods help/hints

Hi I am writing a poker code that mainly implements the use of Arrays.
I am kinda confused on these certain methods I have to make.
Please help me correct something If I am doing something wrong.
Thank you.

---------------------------------------------Constructor Summary

Card(int value, int suit)
Standard constructor.

Method Summary

int getSuit()
"Getter" for suit of Card.
int getValue()
"Getter" for value of Card.
java.lang.String toString()
Returns the name of the card as a String.

/**[B]public Deck()[/B] -- This constructor initializes the Deck with 52 card objects,
representing the 52 cards that are in a standard deck. The cards must be ordered
as in the diagram below: **/
public class Deck {
private Card[] cards;
public Deck() {
this.cards = new Card[52]; //index [0,51]
int index = 0;
for (int suit = 0; suit <= 3; suit++){
for (int value = 1; value <= 13; value++){
this.cards[index] = new Card(value, suit);
index++;
}
}
}
/** Important: The FIRST card in your array should be the Ace of Spades,
and the LAST card should be the King of Diamonds.
Note that in the picture above, the Ace of Spades
is at the TOP of the deck, which is to the left. **/
public Deck(Deck other) /** -- Standard copy constructor.
Note that it is okay to make a shallow copy of the array of cards.
(The Card class is immutable, so aliasing Cards is not a problem.) **/
this.cards = other.cards;
}
public Card getCardAt(int position) /**-- Returns the card that is at the specified position in the array.
(Uses the usual 0-based indexing.)**/
int position = this.cards.getValue; //Don't understand how this getter works.
return;
}
public int getNumCards() /** -- Returns the size of the array of Cards. (It starts off equal to 52, but becomes smaller as cards are dealt from the deck.)**/
this.cards = new Cards [this.cards.length-i] //Confused about how to do this
return;
}

Re: Arrays-Poker Simulation Methods help/hints

Is this a deep or shallow copy? I'm assuming deep in which case I would expect a copy construct within the card class as well.

getCardAt() just returns the instance of Card at the required position within the array.

The implementation depends on the type of array you are using, whether this is fixed or a type of list. As you are using a fixed size array then there needs to be a way of either removing a card from the pack as it is dealt or to record the number of cards which have been dealt.

Re: Arrays-Poker Simulation Methods help/hints

A lot of this is down to personal interpretation, how would you do this with a real set of cards? For example each person would have their own way of shuffling, dealing and cutting the deck.

One solution to shuffle the pack would be to randomly switch each card in the pack. You could also switch one random card with another a random number of times.

To deal a card you would remove a card from start or end of the card array and assign it to a player. How you want to remove the card from the array can be done by nulling the position or reducing the size of the array.

As for cutting the deck, would you like to split the pack or use this function to obtain a random card?