Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

bool? example = null; is actually Nullable<System.Boolean> example = null; Now f

ID: 644473 • Letter: B

Question

bool? example = null;
is actually

Nullable<System.Boolean> example = null;
Now for the bool to System.Boolean conversion or actually compile-time replacement:
We ususally hardly care, as it is very obvious. I even think I never used System.Int32 or anything.

However:
The conversion into a Nullable<T> through appending a ?, that is something not so common. It is not custom to VS(#devel does it too) and my guess is that it is some secret magic in the compliler.

My question is:
Are there more of these "Conversions" / typing shortcuts available in .NET / C#?
I do NOT mean keyboard shortcuts.
A term to google for or something similar migth be best.

Explanation / Answer

This is called