下面的程序Compilation error ,如何改! static void throwMethod() throws IllegalAccessException { System.out.println("Inside throwMethod."); } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public class ThrowsDemo { static void throwMethod() throws IllegalAccessException{ System.out.println("Inside throwMethod."); throw new IllegalAccessException("demo"); } public static void main(String args[]) { try { throwMethod(); } catch (IllegalAccessException e) { System.out.println("Caught " + e); } }}这样就好了嘛! 或者:static void throwMethod() throws IllegalAccessException { System.out.println("Inside throwMethod."); throw new IllegalAccessException("demo"); } 关于Java泛型的问题,知道的请进!!! 我把数据库里的数据存到了一个BufferedInputStream ,怎么分离出他原来的数据啊?有没有知道的,谢谢! 请教一个统计数据的问题。 一个极难的深层递归如何返回的问题? 重复登录 如何让该编码,不打印出日文,我想给jsp的下拉列表赋值 GUI SWING 显示数据输出 求NetBeans 窗体调用代码 是不是JAVA里没有变量屏蔽的概念呢? Rational Rose怎么导入java类库 “String chr”---这个定义竟然错! 关于读取socket问题的求教[很奇怪的现象]
static void throwMethod() throws IllegalAccessException{
System.out.println("Inside throwMethod.");
throw new IllegalAccessException("demo");
}
public static void main(String args[]) {
try {
throwMethod();
} catch (IllegalAccessException e) {
System.out.println("Caught " + e);
}
}
}这样就好了嘛!
System.out.println("Inside throwMethod.");
throw new IllegalAccessException("demo");
}