//static 表态的 final修饰符,子类不能重写 //throws Exception声明在方法参数的后面,有可能会抛出异常,可以抛出多个异常; public static final void testThrow(String str) throws Exception { try { System.out.println("你好Throws Throw"); } catch (Exception e) { //声明在方法体内,抛出异常 throw e; } }
//static 表态的 final修饰符,子类不能重写 //throws Exception声明在方法参数的后面,有可能会抛出异常,可以抛出多个异常; public static final void testThrow(String str) throws Exception { try { System.out.println("你好Throws Throw"); } catch (Exception e) { //声明在方法体内,抛出异常 throw e; } }