Search⌘ K
AI Features

Quiz Yourself: Classes and OOP

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

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

Why is the this keyword unavailable inside a static method?

A.

The this keyword references a specific instance, but static methods operate on the type level and are not associated with any particular object instance.

B.

Static methods are compiled before instance methods, so the this reference has not yet been assigned a memory address by the runtime environment.

C.

The this keyword is reserved for accessing private fields, and static methods are strictly limited to accessing public members of the class.

D.

Static methods are immutable by definition, and using this implies a state change to the current object, which violates the static contract.


1 / 14
...