How Inheritance Affects PROTECTED Methods and PropertiesLast reviewed: April 30, 1996Article ID: Q128633 |
The information in this article applies to:
SUMMARYThis article explains how protected properties and methods are inherited when a class is derived from another class definition. It specifically addresses these issues:
MORE INFORMATIONMembers variables (properties) or procedures (methods) are by default visible outside a class definition. Once an object has been instantiated, its properties and methods can be accessed by other objects. The PROTECTED keyword prevents access to the Object's properties and methods from outside the object's definition. A PROTECTED property or method is visible to the member functions of the class that declared these members, and it is visible to the member functions of a class derived from this class. In other words, protected properties, objects members, and methods are inherited. When PROTECTED members are inherited, they still have a PROTECTED status. Although it is possible to redefine the content of properties and methods in a derived class, the PROTECTED status of a member variable cannot be overridden. If you need to modify this status in a subclass, you can add a member variable to the class. The goal of the new property or method that is visible to other objects is to access the PROTECTED member variable from within the class definition.
|
Additional reference words: VFoxWin 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |