package com.jr.test;import java.lang.reflect.Method;public class MyTest {
public static void main(String[] args) {
String strClassName = "com.jr.testclass.MyClass";
Class cl = Class.forName(strClassName);
}
}main函数所在包com.jr.test。我需要通过反射机制来使用另外一个包的类,这个类叫com.jr.testclass.MyClass。两个包同在一个工程下,但为什么Class.forName下面直接被画了红线(eclipse)?报错“Unhandled exception type ClassNotFoundException”请问是什么原因呢?谢谢!