次のエラーメッセージは何を意味しますか?Eclipse Javaコンパイラのエラー
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
それが好きではない行は次のようになります。
public static void main(String[] args) {
次のようにあなたは、コンテキストのためにそれを参照する必要がある場合は私の完全なWIPコードです。 Eclipseは自動的にその行を設定しています。以前はこれまで問題がありませんでした。
public class Card {
public class cardValue()
public static int suit;
public static int faceValue;
{
static int getfaceValue()
{
return faceValue;
}
setfaceValue(String faceValue)
{
cardFaceValue = faceValue;
return faceValue;
}
static int getSuit()
{
return suit;
}
setSuit(int suit)
{
cardSuit = suit;
return suit;
}
}
public static void main(String[] args) {
cardValue card1 = new cardValue();
// Suit values into strings for Hearts,Spades,Clubs, Diamonds
if (cardValue.getSuit() == 1)
{
System.out.print(" of Hearts");
}
if (cardValue.getSuit() == 2)
{
System.out.print(" of Spades");
}
if (cardValue.getSuit() == 3)
{
System.out.print(" of Clubs");
}
if (cardValue.getSuit() == 4)
{
System.out.print(" of Diamonds");
}
System.out.println(card1.getSuit());
}
}
あなたがやろうとしていますか? –
**最初の**エラーは3行目です: 'public class cardValue()'。その行は何をすべきか? [IDEONE](https://ideone.com/RVFXG2#cmperr)を参照してください。あなたのエラーを上から修正します(そしてそれらの多くがあります)。 – Andreas
エラーメッセージは、コードが有効なJavaではないことを意味し、このEclipseのためにコンパイルできません。エラーを含むコードは実行できません。 –