zoukankan      html  css  js  c++  java
  • 反射中getFields()与getDeclaredFields()区别

    * getFields()与getDeclaredFields()区别:getFields()只能访问类中声明为公有的字段,私有的字段它无法访问,能访问从其它类继承来的公有方法.getDeclaredFields()能访问类中所有的字段,与public,private,protect无关,不能访问从其它类继承来的方法  

    * getMethods()与getDeclaredMethods()区别:getMethods()只能访问类中声明为公有的方法,私有的方法它无法访问,能访问从其它类继承来的公有方法.getDeclaredMotheds()能访问类中所有的方法,与public,private,protect无关,不能访问从其它类继承来的方法  

    * getConstructors()与getDeclaredConstructors()区别:getConstructors()只能访问类中声明为public的构造函数.getDeclaredConstructors()能访问类中所有的构造函数,与public,private,protect无关  

    版权归本人所有,转载请注明出处。
  • 相关阅读:
    面向对象的----多态性
    UIWebView控件
    UIImageView控件
    UIDatePicker控件
    UIActivityIndicatorView控件
    UIProgressView控件
    XIB文件链接controller文件&&加载rootviewcontroller
    UISegmentedControl控件
    UISlider控件
    UISwitch控件
  • 原文地址:https://www.cnblogs.com/wqfeng-2017/p/6691948.html
Copyright © 2011-2022 走看看