Quiz Yourself: Classes and OOP

Assess your understanding of C# classes and object-oriented programming.

We'll cover the following...
Technical Quiz
1.

Which statement correctly describes the execution timing of a static constructor in C#?

A.

It executes every time the class is loaded into memory, which happens whenever a new method referencing the class is entered.

B.

It executes immediately when the application starts (at entry point), guaranteeing initialization before the Main method begins execution.

C.

It executes exactly once before any instance of the class is created or any static member is referenced, and it cannot be invoked manually.

D.

It executes whenever a new instance is created, but prior to the execution of the regular instance constructor to ensure static fields are ready.


1 / 14