Extends 继承 (2)

The private properties/methods of the Superclass cannot be accessed by subclass.
The non-private properties/methods of the Superclass can be access by subclass’s objects directly.

总结:
1. “private” can’t be “extends”
2. “private” 物理上已经被继承过来了,只不过逻辑上不能访问他。所以继承必须慎重,否则浪费内存空间。

posted @ 2011-12-02 07:42  allenbackpacker  阅读(107)  评论(0编辑  收藏  举报