你这个代码没贴全的感觉呀……
public class MethodTest_1 {
public static void main(String[] args) throws NoSuchMethodException,
SecurityException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException {
String str = "test";
Method methodcharAt = String.class.getMethod("charAt", int.class);
methodcharAt.invoke(str, 2);
}
}
原因应该是没抛出异常吧……
|