?? exceptiondemo.java
字號(hào):
class ExceptionDemo
{
public int Result(int i) throws Exception
{
if(i<0)
throw new Less0Exception("result is:"+i);
if(i>100)
throw new More100Exception("result is:"+i);
int j=i;
return j;
}
class Less0Exception extends Exception
{
public Less0Exception(String msg)
{
super(msg);
}
}
class More100Exception extends Exception
{
public More100Exception(String msg)
{
super(msg);
}
}
}
class Test
{
public static void main(String args[]) throws Exception
{
ExceptionDemo t=new ExceptionDemo();
t.Result(150);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -