Determining the "Scope" of Methods and Variables

Methods interact with variables and their associated data. But a method cannot interact with just any variable. Certain methods and variables are designed to work together. A method designates the variables it wants to work with by exposing them using an EXPOSE instruction. The exposed methods are called object variables. Exposing variables confines them to an object; in object-oriented terms, we say they are encapsulated. This protects the object variables' data from being changed by "unauthorized" methods belonging to other objects.


[Back: The Default Search Order for Environment Objects]
[Next: Objects with a Class Scope]