谁能帮我看看哪出错了啊!!!
// 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
帮我看看好吗????