在C#和VB中声明时变量的默认值? [英] default value of a variable at the time of declaration in C# and VB?
本文介绍了在C#和VB中声明时变量的默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我在C#和vb中声明时变量的默认值是什么吗?
Can anybody tell me what is the default value of a variable at the time of declaration in C# and vb??
推荐答案
在c#中,可以使用default关键字确定默认值。
In c# you can use the default keyword to determine default values.
例如:
default(bool)
default(int)
default(int?)
这篇关于在C#和VB中声明时变量的默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文