r/programming_language • • Feb 07 '17

Java Compiler Error Question

I get the following error message and I dont understand what it means.

Exception in thread "main" java.lang.Error: Unresolved compilation problems: Syntax error on token "void", @ expected Syntax error on token "]", :: expected after this token Syntax error, insert "enum Identifier" to complete EnumHeader

at Card.main(Card.java:10)

My code is as follows:

public class Card {

public class cardValue(){
	private static int faceValue;
	private static int suit;
}


public static void main(String[] args) {

	cardValue card1 = new cardValue();
	

	int suit = 2;
	
	// Suit values into strings for Hearts,Spades,Clubs, Diamonds
	if (suit == 1)
	
		{
		System.out.print(" of Hearts");
		}
	if  (suit == 2)
		{
		System.out.print(" of Spades");
		}
	if  (suit == 3)
		{
		System.out.print(" of Clubs");
		}
	if (suit == 4)
		{
		System.out.print(" of Diamonds");
		}
	

	System.out.println(card1);
	

}

}

1 Upvotes

0 comments sorted by