为什么我的Class.forName()抛出的异常不是
ClassNotFoundException,而是
RuntimeException?
try {
Class c = Class.forName( "aaaaa ");
c.newInstance();
} catch (Exception e) {
if (e instanceof Class
NotFoundException)
System.out.println( "ClassNotFoundException ");
else if (e instanceof RuntimeException)
System.out.println( "RuntimeException ");
}
------解决方案--------------------绝对是ClassNotFoundException
你真的执行过吗
------解决方案--------------------度过ClassNotFoundException