Difference between NoSuchMethodException and NoSuchMethodError in Java

前端 未结 4 1416
礼貌的吻别
礼貌的吻别 2021-02-19 01:47

I can\'t find exact difference between NoSuchMethodException and NoSuchMethodError in Java. Could someone give explanation and example of these two th

4条回答
  •  攒了一身酷
    2021-02-19 02:18

    Class NoSuchMethodException:

    Thrown when a particular method cannot be found.

    Class NoSuchMethodError

    Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.

    Also see this article, it explains it better.

提交回复
热议问题