throwtest.java
来自「Java与面向对象程序设计实验教学讲义.复数类的实现,复数类的复杂运算,身份证号」· Java 代码 · 共 25 行
JAVA
25 行
class ThrowTest
{
public static void main(String args[])
{
try
{
throw new ArithmeticException();
}catch(ArithmeticException ae){
System.out.println(ae);
}
try
{
throw new ArrayIndexOutOfBoundsException();
}catch(ArrayIndexOutOfBoundsException ai){
System.out.println(ai);
}
try
{
throw new StringIndexOutOfBoundsException();
}catch(StringIndexOutOfBoundsException si){
System.out.println(si);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?