【发布时间】:2010-12-23 07:14:10
【问题描述】:
我正在尝试通过反射调用方法。有问题的方法,让我们说
public void someMethod(someInterface<someObject> arg1)
我在运行时无权访问someMethod 和someInterface,必须通过调用
someclass.getMethod("someMethod", new Class[]{Class.forName("someInterface")})
.invoke(...)
但它失败并出现 someInterface 的 ClassNotFound 异常。如何获取接口的Class 对象?
【问题讨论】:
标签: java reflection interface