GetType和typeof的区别
摘要:
typeof: The typeof operator is used to obtain the System.Type object for atype.运算符,获得某一类型的System.Type对象。Type t = typeof(int);GetType: Gets the Type of the current instance.方法,获取当前实例的类型。 int i = 10;Console.WriteLine(i.GetType());区别:Typeof()是运算符而GetType是方法GetType()是基类System.Object的方法,因此只有建立一个实例之后才能够被调 阅读全文
posted @ 2014-01-10 14:20 %幻#影% 阅读(321) 评论(0) 推荐(0)
浙公网安备 33010602011771号