Home »
MCQs »
C# MCQs
What does the access modifier do in C#?
77. What does the access modifier do in C#?
- To maintain the syntax
- To define a variable inside the class
- To access the variables defined inside the class
- To control the visibility of class members
Answer: D) To control the visibility of class members
Explanation:
In C#, there are 4 types of access modifiers they are public, private, protected, and internal. And these access modifiers are used to control the visibility of class members (the security level of each individual class and class member).