?? testdiv.java
字號:
/**
* Description:
* <br/>Copyright (C), 2005-2008, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class TestDiv
{
public static void main(String[] args)
{
try
{
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int c = a / b;
System.out.println("您輸入的兩個數相除的結果是:" + a / b);
}
catch (IndexOutOfBoundsException ie)
{
System.out.println("數組越界:運行程序時輸入的參數個數不夠");
}
catch (NumberFormatException ne)
{
System.out.println("數字格式異常:程序只能接受整數參數");
}
catch (ArithmeticException ae)
{
System.out.println("算術異常");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("未知異常");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -