I am currently working on a Poker java game exercise, and I get this ugly error which I’m not being able to understand. It must be some kind of syntax error since the compiler throws 100 of those. But I just don’t know where the error is??
import java.util.Random;
public class Poker
{
private Card[] deck;
private Card[] hand;
private int currentCard;
private int numbers[], triples, couples;
private String faces[], suits[];
private boolean flushOnHand, fourOfAKind, isStraight;
private static final int NUMBER_OF_CARDS = 52;
private static final Random randomNumbers = new Random();
Poker()
{
faces = { "Ace", "Deuce", "Three", "Four", "Five",
"Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
suits = { "Hearts", "Diamonds", "Clubs", "Spades" };
numbers = new int[ 13 ];
deck = new Card[ NUMBER_OF_CARDS ];
triples = 0; // right here's where the compiler starts complaining
couples = 0;
...
though I am not able to spot any syntax error?
Btw, the Card is a separate class.
There’s no reason why the variable
triplescan’t be assigned where you are indicating the error.However, you need to assign the String arrays like so: