Encapsulation enables the developer to hide information. Information is hidden, not as much to limit access, but to make an object easier to use for its consumers.
Visual Basic enables access to information within classes through Access Modifiers. Access Modifiers determine who has access to what.
- Private - often reffered to as member variables and designated with an "m". Only available in the code where the variable or method was declared.
- Public - accessable anywhere within the application
- Friend - accessable only by members of the class where it was declared
- Protected - accessable only by members of the class where it was declared, or by members of the inheriting class.
- Shared - used in a base class. The value of a shared property will change accross all instances of the class, even when the class has several implementations.
No comments:
Post a Comment