Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer Certification Test. Use multiple choice quizzes with hints and explanations to boost your readiness. Excel on your test!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which of the following is NOT an access modifier in C#?

  1. Private

  2. Protected

  3. Public

  4. Static

The correct answer is: Static

In C#, access modifiers are keywords used to define the accessibility of classes, methods, and other members. The primary purpose of these modifiers is to manage the visibility and accessibility of class members from other classes. The common access modifiers in C# include Private, Protected, Public, and Internal. Private restricts access to the containing class only, meaning that no other class can access it directly. Protected allows access to the containing class and any derived classes, which is useful for inheritance scenarios. Public, on the other hand, allows access to the class members from any other code, providing the least restricted access. Static is not an access modifier; it is a keyword that signifies that a particular member belongs to the type itself rather than an instance of the type. Static members can be accessed without creating an instance of the class, but they aren't used to control visibility in the same way as Private, Protected, and Public. Understanding the specific roles of each of these terms is crucial for effective programming in C#. Knowing that Static represents a type's member behavior rather than its accessibility helps clarify why it does not fit in with the rest of the options, which are all focused on access control.