
编译提示找不到符号 ScaryException 这是为什么啊
publicclassTestException{publicstaticvoidmain(String[]args){Stringtest="no";try{Syste...
public class TestException
{
public static void main (String [] args)
{
String test = "no";
try
{
System.out.println ("start try");
doRisky (test);
System.out.println ("end try");
}
catch (ScaryException se)
{
System.out.println ("scary exception");
}
finally
{
System.out.println ("finally");
}
System.out.println ("end of main");
}
static void doRisky (String test) throws ScaryException
{
System.out.println ("start risky");
if ("yes".equals (test))
{
throw new ScaryException ();
}
System.out.println ("end risky");
return;
}
} 展开
{
public static void main (String [] args)
{
String test = "no";
try
{
System.out.println ("start try");
doRisky (test);
System.out.println ("end try");
}
catch (ScaryException se)
{
System.out.println ("scary exception");
}
finally
{
System.out.println ("finally");
}
System.out.println ("end of main");
}
static void doRisky (String test) throws ScaryException
{
System.out.println ("start risky");
if ("yes".equals (test))
{
throw new ScaryException ();
}
System.out.println ("end risky");
return;
}
} 展开
1个回答
展开全部
in这个变量没有定义,所以报了这个错误。
我猜你本来的想法应该是这个样子的。
int grade = input.nextInt();
类名可以用首字母大写。public class You
我猜你本来的想法应该是这个样子的。
int grade = input.nextInt();
类名可以用首字母大写。public class You
追问
这是啥
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询