开发者

Value of reference type before "new" keyword

开发者 https://www.devze.com 2023-02-05 00:04 出处:网络
I would like to clarify following. I know that reference type variable contains reference to block of memory which can contain value of that type. But before that value is assigne开发者_运维问答d by u

I would like to clarify following. I know that reference type variable contains reference to block of memory which can contain value of that type. But before that value is assigne开发者_运维问答d by using "new" keyword, the reference just points to empty place in memory?


Unassigned fields are null references.
You can think of a null reference as pointing to nowhere.


It's a null for reference types, and default(type) for value types. However, the compiler will prevent you from using unassigned fields and variables.

0

精彩评论

暂无评论...
验证码 换一张
取 消