1. typeof操作符用于获得系统原型对象的类型;
2.举例子:
using System;
calss Test
{
static void Main()
{
Console.WriteLine(typeof(int));
Console.WriteLine(typeof(System.Int32));
Console.WriteLine(typeof(string));
Console.WriteLine(typeof(double[]));
}
}
3. 产生如下输出:
Int32
Int32
String
Double[]
表明int和system.int32是同一类型。
|