Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition
by Paul J. Deitel - Deitel & Associates, Inc., Harvey M. Deitel - Deitel & Associates, Inc.
9.3. Class Scope
In Section 7.16, we discussed method scope; now, we consider class scope. A class’s instance variables and methods belong to its scope. Within a class’s scope, class members are accessible to all of the class’s methods and properties and can be referenced simply by name (without an object reference). Outside a class’s scope, class members cannot be referenced directly by name. Those class members that are visible (such as Public members) can be accessed through a “handle” (i.e., members can be referenced via names of the form objectReferenceName.memberName or ClassName.memberName for Shared members). For example, line 56 of Fig. 9.2 accessess a Time object’s method with the method call time.ToUniversalString().
If a variable ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access