typeof和GetType区别

it2026-10-03  4

两者都是返回当前的类型

1、typeof(X);    其中的 X 是类型。2、X.GetType();    其中的 X 是变量或类型的实例。例如:有变量 string str=new string();   typeof表示:  typeof(string)   GetType表示:  str.GetType() 

转载于:https://www.cnblogs.com/wupeiqi/archive/2013/05/09/3068279.html

相关资源:数据结构—成绩单生成器
最新回复(0)