In C#, what is the default value of a class instance variable of type int?
?
For example, in the following code, what value will MyNullableInt
have if it is never explicitly assigned?
class MyClass
{
public int? MyNullableInt;
}
(It seems likely that the answer is almost certainly either null
or 0
, but which of those is it?)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…