标题:[求助]illegal start of expression这个误是什么啊?哪错了啊?
取消只看楼主
yu46111
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2006-3-10
 问题点数:0 回复次数:0 
[求助]illegal start of expression这个误是什么啊?哪错了啊?

谁能帮我看看哪出错了啊!!!
// Java Document
package test;
import java.util.*;

public class GuessBean
{
int answer;
boolean success;
String hint;
int numGuesses;
public GuessBean()
{
reset();
}
public void setGuess(String guess)
{
numGuesses++;
int g;
try{g=integer.parseInt(guess);}
catch(NumberFormatException e){g=-1;}
if(g==answer)
{sucess=true;}
else if(g==-1)
{hint="a number next time";}
else if(g<answer)
{hint="highter";}
else if(g>answer)
{hint="lower";}
public boolean getSuccess()
{
return success;
}
public String getHint()
{return " " +hint;}
public int getNumGuesses()
{return numGuesses;}
public void reset()
{
answer=Math.abs(new Random().nextInt()%100)+1;
success=false;
numGuesses=0;
}
}

}结果编后出现这个错误:

GuessBean.java:29: illegal start of expression
public boolean getSuccess()
^
GuessBean.java:43: ';' expected
}
^
2 errors
帮我看看好吗????

搜索更多相关主题的帖子: expression start illegal 
2006-03-10 12:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-49522-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.160021 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved