码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA反射中的getFields()方法和getDeclaredFields ()方法的区别

时间:2020-03-04 15:06:08      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:ons   private   tps   declare   blog   eth   href   父类   方法   

getFields:获取所有公共的public修饰的方法,包括父类的方法

getDeclaredFields:获取所有本类声明的方法,包括private修饰的,但是不包含父类的方法。

类似的还有 getMethods 与 getDecalredMethods, getConstructors()和getDeclaredConstructors();

 

https://www.cnblogs.com/JackZed/p/6888668.html

JAVA反射中的getFields()方法和getDeclaredFields ()方法的区别

标签:ons   private   tps   declare   blog   eth   href   父类   方法   

原文地址:https://www.cnblogs.com/warrior4236/p/12409141.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!