Subclasses can inherit all the parent class, member variables, or even private, but do not have access to these private member variables and methods

 

1, on the private member variables

 

Whether the parent class member variables are private, shared, or other types of sub-class will have these member variables in the parent class. But private member variables in the parent class can not directly access in the subclass must be accessed through protected, public methods (such as getter, setter methods) to get inherited from the parent class.

 

 

 

2, on the static member variables

 

Whether the parent class member variable is static or non-static, sub-class will have these member variables in the parent class.

 

 

 

3, member variables on the quilt class coverage

 

Whether the parent class member variable of whether the quilt class coverage, these sub-class will have member variables in the parent class.

 

Guess you like

Origin www.cnblogs.com/shoose17/p/11404495.html