Powered by Blogger.

Saturday, March 8, 2014

Access specifiers in C#.Net



In this article we will discuss about different access specifiers in C#.Net.

Also you can check out:

- RequiredFieldValidator example in Asp.Net

- How to use WSDL.exe in Asp.Net?

- How to display serial number automatically in GridView in asp.net?

The accessibility determines whether other parts of your code will be able to read and alter this variable.

This accessibility apply to variables, methods, properties, and events etc.

public:
Can be accessed by any class.

private:
Can be accessed only by members inside the current class internal Can be accessed by members in any of the classes in the current assembly.

protected:
Can be accessed by members in the current class or in any class that inherits from this class.

protected internal:
Can be accessed by members in the current application (as with internal) and by the members in any class that inherits from this class.