Chapter 10 discussed access modifiers
private. A class’s
public members are accessible wherever the app has a reference to an object of that class or one of its derived classes. A class’s
private members are accessible only within the class itself. A base class’s
private members are inherited by its derived classes, but are not directly accessible by derived-class methods and properties. In this section, we introduce access modifier
protected access offers an intermediate level of access between
private. A base class’s
protected members can be accessed by members of that base class and by members of its derived classes.
private base-class members retain their original access ...