?? try5.java
字號(hào):
public class Try5
{
public void run(byte k)
{
byte y=1,i=1;
System.out.print(k+"!=");
for (i=1;i<=k;i++)
{
try
{
if(y>Byte.MAX_VALUE/i) //Integer類的常量
throw new Exception("overflow"); //溢出時(shí)拋出異常
else
y = (byte) (y * i);
}
catch(Exception e)
{
System.out.println("exception: "+e.getMessage());
e.printStackTrace(); //顯示異常信息
System.exit(0);
}
}
System.out.println(y);
}
public static void main (String args[])
{
Try5 a = new Try5();
for (byte i=1;i<10;i++)
a.run(i);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -