Hey im trying to make a card of deck
the deck should contain 52 cards,
ofc with spade,diamonds,heart,clubs with ranks ,
this is my code so far i havent gotten any longer Thanks for help in advance.
get the deck to shuffle cards ,Create a class that represents a deck containing 52 cards, When a new object of this class is created, the deck is initialized with the cards that it will contain.
public class Card {
int[] deck = new int[52];
String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"};
String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"};
Card() {
for (int i = 0; i < deck.length; i++) {
deck[i] = i;
}
}
}