What are the accessibility levels of class members defined in .NET?

by kevin| Views: 1268

Different levels of accessibility of class variable in C#?

What are the accessibility levels of class members defined in VB.NET?

What are the access specifiers available in .Net Framework?

Answers (1)
 
Zulfiqar Said..

You can use five levels of access modifiers in (C#, VB.NET) :-

public :- All members have access in all classes and projects.

private: Only members of class have access.

protected: All members in current class and in derived classes can access the variables.

friend in VB.NET (internal in C#) :- Only members in current project/assembly have access to the elements.

protected friend in VB.NET (protected internal in C#) :- All members in current project/assembly and all members in derived class can access the variables.



Register or Login to Post Your Opinion/Answer