multicatch.java
来自「这是清华大学编写的JAVA教材中所有题目的源代码!」· Java 代码 · 共 21 行
JAVA
21 行
class MultiCatch
{
public static void main(String args[])
{
try
{
String num=args[0];
int numValue=Integer.parseInt(num);
System.out.println("平方为 "+numValue*numValue);
}
catch(ArrayIndexOutOfBoundsException ne)
{
System.out.println("未提供任何参数!");
}
catch(NumberFormatException nb)
{
System.out.println("不是数字!");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?