December 2012
Beginner
552 pages
12h 58m
English
You know by now that instance variables have scope that is limited to the instance methods defined for the class. So, any instance method can access its instance variables directly by name, without having to do anything special.
You also know that instance variables declared in the interface section are inherited by a subclass. Inherited instance variables can also be accessed directly by name from within any method defined in that subclass. Again, this is without having to do anything special.
You can put four directives in front of your instance variables when they are declared in the interface section, to more precisely control their scope:
• @protected—Methods defined in the class and any ...
Read now
Unlock full access