【问题标题】:Using reflection , is there a way to get the fields of the superclass?使用反射,有没有办法获取超类的字段?
【发布时间】:2012-03-29 16:40:29
【问题描述】:

我正在使用反射来获取特定类的 DeclaredFields。有没有办法能够检索特定类的超类字段?

【问题讨论】:

  • 答案是肯定的,但你应该在问这里之前自己尝试过

标签: java reflection superclass


【解决方案1】:

你试过了吗?

myClass.getSuperClass().getDeclaredFields();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2022-01-08
    • 2017-05-08
    • 1970-01-01
    相关资源
    最近更新 更多