In my method, I am trying to use a declared constant called CLB in my main method. This constant is in another class called Card. When I try to to use setSuit, a method I wrote, in the main class, it gives me "Symbol not found"
I have a class called Card...
public class Card {
private char value;
private char suit;
public String card = "";
final int NOC = 52; //number of cards
final int NOF = 4; //number of faces
final int NOV = 13; //number of values
//SUITS; 3 letter designation
private final char CLB = '\u2663';
private final char SPD = '\u2660';
private final char HRT = '\u2764';
private final char DMN = '\u2666';
//Array of suits and values
public char[] cardSuit = {CLB, SPD, DMN, HRT};
public char[] cardValue = {'A', 'K', 'Q', 'J', 10, 9, 8, 7, 6, 5, 4, 3, 2};
//CONSTRUCTOR
public Card(){}
public Card(char suit, char value)
{
this.suit = suit;
this.value = value;
}
public void setSuit(char s)
{
if (contains(cardSuit, s))
{
suit = s;
}
Here is main...
public static void main(String[] args) {
Card test = new Card();
test.setSuit(CLB);
I'm not quite sure what I'm doing wrong since in my understanding, the object test should contain the suits.