Does null inherit from Object as well in C#?
Where does the null itself defined?
Does null inherit from Object as well in C#?
Unlike in some other systems, null
is not defined in terms of a class or an instance. On the contrary, it signifies the absence of any instance, and it doesn't have a type. It is implicitly converted to whatever reference type fits the context. The widest conversion (i.e. when no other can be inferred) is to object
. But still, null
is not generally of type object
.
null
is not an object - it is a language keyword that denotes the lack of an object reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With