开发者

Value of reference type before "new" keyword

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜