Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You can influence the scope of the variables in your program in several ways. You can do this with instance variables as well as with normal variables defined either outside or inside functions. In the following discussion, we use the term module to refer to any number of method or function definitions contained within a single source file.
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.