0
点赞
收藏
分享

微信扫一扫

Class.getMethod如何获取具有泛型参数的Method对象

兵部尚输 2022-10-27 阅读 104


public <E extends Exception,T1,T2,TR extends ArrayList<String>> TR testGeneric(Test this, T1 a1, T2 a2) throws IndexOutOfBoundsException,E {
return (TR) new ArrayList<String>();
}


Method m = Test.class.getMethod("testGeneric", Object.class,Object.class );


举报

相关推荐

0 条评论