how to create a deck of cards constructor

后端 未结 3 1331
孤独总比滥情好
孤独总比滥情好 2021-01-21 17:37

so far this is what I have

import java.util.Random;
public class DeckOfCards
{
public static final int DECK_SIZE = 52;

//Instance Variables
private boolean[] de         


        
3条回答
  •  不知归路
    2021-01-21 18:00

    Myself, I'd use an array of Card objects for my deck variable, not an array of booleans. The primitive boolean variable can only be in one of two states, true or false, whereas a Card must have both a suit (1 of 4 states) and a rank (1 of 13 states).

提交回复
热议问题