I recently decided to start using enum for my card Suit however it seem that I can't resolve this error no matter how I type up the code.
Edited:
/**
*
* A basic constructor class that build the card object.
* The card object will contain value for both the Suit and
* card's Value.
*
*
*
*/
public class Card {
public Enum SUIT{SPADE, CLUB, DIAMOND, HEART};
// This will identify the card suit.
public Enum suit;
//This will hold the card value.
//Jack = 11 ... Ace = 14
public int value;
public Card(Enum suit, int value){
this.suit = suit;
this.value = value;
}
}
I have look up various answer on the site and look through the official Java Documentation on Orcacle. Can someone help me figure this out?
Update:
/**
* * A basic constructor class that build the card object. * The card object will contain value for both the Suit and * card's Value. * * * */ public class Card {
public enum Suit{SPADE, CLUB, DIAMOND, HEART};
// This will identify the card suit.
private final Suit suit;
//This will hold the card value.
//Jack = 11 ... Ace = 14
private final int value;
public Card(Suit suit, int value){
this.suit = suit;
this.value = value;
}
}
Here a screenshot of the errors: A screenshot of the error