public class ThrowException { public static void main(String[] args) { try{ //由于ThrowException申明会抛出异常,所以编译器会强制程序员在此捕获异常 ThrowException(); }catch (Exception
该题目主要考查的是对catch语句的使用,首先要在程序中使用多个异类,并依次使用catch语句获得。 //编写一个程序来说明多个catch语句顺序的重要性 public class TheOrderCatch { public static void main(String[] args) { int n = 0; int array[] = new int
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号