Compiler errors 获得;找不到符号“;从其他类引用方法时出错
我正在写一个战争游戏,有3个文件。Card类具有卡的定义和操作卡的方法。FullDeck类包含创建一张卡和一副卡的方法。代码如下所示Compiler errors 获得;找不到符号“;从其他类引用方法时出错,compiler-errors,cannot-find-symbol,Compiler Errors,Cannot Find Symbol,我正在写一个战争游戏,有3个文件。Card类具有卡的定义和操作卡的方法。FullDeck类包含创建一张卡和一副卡的方法。代码如下所示 public class FullDeck { public Card CreateCard(int s, int c) { Card aCard = new Card(); aCard.SetSuit(s); aCard.SetCardVal(c); return aCard; } public void CreateDeck(Card
public class FullDeck
{
public Card CreateCard(int s, int c)
{
Card aCard = new Card();
aCard.SetSuit(s);
aCard.SetCardVal(c);
return aCard;
}
public void CreateDeck(Card [] cDeck)
{
int sval; // Suit value
int cval; // Card value
int ctr = 0; // Counter
final int highValue = 13; // Highest card value
final int numSuits = 4; // Number of suits
int theSuitNum;
for (sval = 1; sval <= numSuits; ++sval)
{
for (cval = 1; cval <= highValue; ++cval)
{
cDeck[ctr] = CreateCard(sval, cval);
theSuitNum = cDeck[ctr].GetSuit();
cDeck[ctr].PrintCard();
ctr = ctr+ 1;
}
}
}
}
公共级全甲板
{
公共卡创建卡(int s,int c)
{
卡片aCard=新卡片();
aCard.SetSuit(s);
aCard.SetCardVal(c);
返回aCard;
}
公共void CreateDeck(卡片[]cDeck)
{
int sval;//适合值
int cval;//卡值
int ctr=0;//计数器
final int highValue=13;//最高卡值
final int numSuits=4;//诉讼数量
int theSuitNum;
对于(sval=1;sval