Die*_*ken 5 c# types typeof
为什么typeof(string).FullName给予System.String而不给予string?同样是与所有其他"简单"类型,如int,float,double,...
typeof(string).FullName
System.String
string
int
float
double
我明白这typeof是返回System.Type给定类型的对象,但为什么string不是一个System.Type对象呢?
typeof
System.Type
是因为它string是c#语言的System.Type一部分,并且是系统库的一部分吗?
Pat*_*man 11
因为string是别名System.String.您的stringC#代码在编译时转换为System.String.这是相同的其他别名.
归档时间:
9 年,10 月 前
查看次数:
1092 次
最近记录: