Java: NoSuchMethodException when method clearly exists

前端 未结 4 777
無奈伤痛
無奈伤痛 2020-12-03 04:28

On my current project, I\'ve felt the need to create a sort of simulated callback system in Java using reflection. However, I\'m having issues getting my reflection to actua

4条回答
  •  执笔经年
    2020-12-03 04:49

    The Javadoc for getMethod isn't explicit, but it looks like it might throw a NoSuchMethodException for methods that aren't public, and your method is private.

提交回复
热议问题