以下是 C# 中的别名列表(赞美C# 中的 String 和 string 有什么区别? https://stackoverflow.com/questions/7074/whats-the-difference-between-string-and-string):
object: System.Object
string: System.String
bool: System.Boolean
byte: System.Byte
sbyte: System.SByte
short: System.Int16
ushort: System.UInt16
int: System.Int32
uint: System.UInt32
long: System.Int64
ulong: System.UInt64
float: System.Single
double: System.Double
decimal: System.Decimal
char: System.Char
我可以看到bool
通过char
是小写别名,因为它们是原始类型。
为什么对象和字符串不大写,因为它们是复杂类型?这是开发人员的疏忽,还是有必要使用小写字母?或者这是一个固执己见的问题?
你最终会得到类似的东西string.Format()
代替String.Format()
,这看起来很时髦,让我思考string
是一个变量。
因为所有keywords https://msdn.microsoft.com/en-us/library/x53a06bb.aspx(保留标识符)是小写的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)