What is the default value of a nullable enum (Nullable<enum>
/ enum?
)?
public enum Days
{
Sun,
Mon,
Tue,
Wed,
Thu,
Fri,
Sat,
};
What will default(Days?)
evaluate to?
Intentionel duplicate of What is the default value of the nullable type βint?β (including question mark)?. If you don't know that nullable integer (int?
) acts the same as nullable enum (enum?
), you do not know that the question is the same, and therefore do not read the question nor its answers.