Beginners Guide: Scoping of Methods
There are four basic scoping modifiers for methods (subs or functions) that are most used in ASP.Net/VB.Net. The are:
- Private
- Protected
- Friend
- Public
Beginning programmers sometimes have a problem understanding exactly what they are used for. These words are put in front of the Sub or Function. The base functionality is that these modifiers are defining the ’scope’ in which they are used – in other words, where and how they can be used within the program in which they reside. The following is just a basic run down of what they mean.
Private
Private means that the sub or function is ONLY available/visible to the current class itself.
Protected
Protected means that the sub or function is ONLY available/visible to the current class AND subclasses derived from it.
Friend
Friend means that the sub or function is visible to the current assembly
Public
Public means that the sub or function is visible to all, and can be utilized as such.
This covers the basics of scoping modifiers for methods, and should at least give you a rudimentary understanding of how they’re used within your project/website.




04. Feb, 2008 








No comments yet... Be the first to leave a reply!