我想通过反射调用一个方法。问题的方法,让我们说Java反射和接口作为参数
public void someMethod(someInterface<someObject> arg1)
我没有在运行时访问someMethod
和someInterface
,并请有
someclass.getMethod("someMethod", new Class[]{Class.forName("someInterface")})
.invoke(...)
调用,但失败了ClassNotFound的例外someInterface
。我如何获得接口的Class
对象?
可能的重复:http://stackoverflow.com/questions/10635025/classnotfound-exception-using-java-reflection – RAS 2012-09-25 06:13:05