Why does null exist in .NET?

前端 未结 11 1548
醉酒成梦
醉酒成梦 2020-12-24 06:04

Why can values be null in .NET? Is this superior to having a guarantee where everything would have a value and nothing call be null?

Anyone knows what each of these

11条回答
  •  轮回少年
    2020-12-24 06:30

    To denote the nothingness concept, since 0 is not the right fit.

    Now you can give any value type a Null value by defining a nullable type.

    I think we can't have a value always for the variable because at first we have to default it to some value, and here comes the question why a specific value takes advantage over the others.

提交回复
热议问题