Public versus Private Methods

A method can be public or private. Any object can send a message that runs a public method. Only a message an object sends to itself (using the special variable SELF as the message receiver) can run a private method. Private methods include methods at different scopes within the same object. (This lets superclasses make methods available to their subclasses while hiding those methods from clients of the object.) A private method is like an internal subroutine. It shields the internal workings of an object.


[Back: Changing the Search Order for Methods]
[Next: Defining an UNKNOWN Method]