getDeclaredMethods()和getMethods()区别

getDeclaredMethods()
          返回 Method 对象的一个数组,这些对象反映此 Class 对象表示的类或接口声明的所有方法,包括公共、保护、默认(包)访问和私有方法,但不包括继承的方法。

getMethods()
          返回一个包含某些 Method 对象的数组,这些对象反映此 Class 对象所表示的类或接口(包括那些由该类或接口声明的以及从超类和超接口继承的那些的类或接口)的公共 member 方法。

本文转自:http://blog.sina.com.cn/s/blog_49f485700100ctxq.html

原文地址:https://www.cnblogs.com/sishuiliuyun/p/4065731.html