Microsoft Exam Questions

You need to ensure that new instances of Connection can…

You have the following code (line numbers are included for reference only):

You need to ensure that new instances of Connection can be created only by other classes by calling theCreate method. The solution must allow classes to inherit from Connection.
What should you do?

A.
Option A

B.
Option B

C.
Option C

D.
Option D

Explanation:
The following list provides the main features of a static class:
* Contains only static members.
* Cannot be instantiated.
* Is sealed.
* Cannot contain Instance Constructors.
Creating a static class is therefore basically the same as creating a class that contains only static members and
a private constructor. A private constructor prevents the class from being instantiated.
Incorrect:
Not A: An abstract method is a method that is declared without an implementation.
Not C: Private methods can be called from derived classes.
Static Classes and Static Class Members (C# Programming Guide)
https://msdn.microsoft.com/en-us/library/79b3xss3.aspx