Monday, July 28, 2008

.NET ACCESS MODIFIERS

There are Five Access Modifiers available in .NET. Following are the functionalities of these Modifiers.


Term Used With… Visibility
Public Variables/Properties/Methods/Types Anywhere in or outside of a project


Private Variables/Properties/Methods/Types Only in the block where defined


Protected Variables/Properties/Methods Can be used in the class where defined. Can be used within any inherited class.


Friend Variables/Properties/Methods Can only be accessed by code in the same project/assembly.


ProtectedFriend Variables/Properties/Methods Combination of Protected and Friend

No comments: