摘要
关于java类中的private成员能否被子类继承的问题,一些书的结论是:不能被继承。文本分析了相关的实例和该实例在eclipse下单步执行过程中的变量内存状态,得出了另一的结论,即private成员能被子类继承,只是不可见。并且在其子类的子类中仍能继承。
some books conclude that private members cannot be inherited by their subclass in java language. After analyzing the memory state of private members under the process of single-step debug, this paper draws another conclusion that private members absolutely can be inherited by their subclass and these inherited private members just are invisible usually.
出处
《软件》
2012年第9期106-108,111,共4页
Software
关键词
子类
私有成员
继承
subclass
private members
inheritance