10.3. Protected Members

Chapter 9 discussed access modifiers Public and Private. A class’s Public members are accessible wherever the program 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 not inherited by its derived classes. This section introduces the access modifier Protected. In Section 10.8, we discuss the access modifier Friend.

Protected access offers an intermediate level of access between Public and Private access. A base class’s Protected members can be accessed only by members of that base class and by members of its derived classes.

All Public and Protected base class members retain their original access ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.