You are supposed to make a Card class.
public class Card {
private String suit;
private int rank;
static String[] value = {"Ace", "One", ..."Jack", "Queen", "King"};
static String[] suits = {"Clubs", "Hearts", "Diamonds", "Spades"};
public Card( int suit, int rank ) {
this.suit = suit;
this.rank = rank;
}
public String toString() {
return "The " + value[ rank ] + " of " + suits[ suit ];
}
}
// then make a driver class
public class Deck {
public static void main( String[] args ) {
Card[] deck = new Card[ 52 ];
int count = -1;
for( int i = 0; i< 4; i++)
for( int j = 0; j<13; j++)
deck[ ++count ] = new Card( i, j );
for( int i = 0; i< deck.length; i++)
System.out.println( deck[ i ] );
}
}