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” 物理上已经被继承过来了,只不过逻辑上不能访问他。所以继承必须慎重,否则浪费内存空间。

原文地址:https://www.cnblogs.com/backpacker/p/2271556.html