62,628
社区成员
发帖
与我相关
我的任务
分享public class Dd
{
public static void main(String[] args)
{
try
{
ss();
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
static void ss()
{
throw new Exception();
}
}
static void ss()
{
System.out.println(1/0);
}
这种为什么不用写[/quote]
这是运行时异常,异常不一样
static void ss()
{
System.out.println(1/0);
}
这种为什么不用写
static void ss() throws Exception
{
throw new Exception();
}