总结一下就是:
1.你要调用的那个方法名字写对
2.public不是protected(要用这个就必须使用Method method=this.getClass().getDeclaredMethod()方法,但是不推荐
3.getMethod()方法里面规定的参数信息匹配,包括顺序
java.lang.NoSuchMethodException异常解决
最新推荐文章于 2023-07-11 11:58:27 发布
总结一下就是:
1.你要调用的那个方法名字写对
2.public不是protected(要用这个就必须使用Method method=this.getClass().getDeclaredMethod()方法,但是不推荐
3.getMethod()方法里面规定的参数信息匹配,包括顺序