请问:GetType()和ToString()是什么意思?
using System;class obj_Sample_Class
{
public int i=10;
}
class MainClass
{
static void Main()
{
object a;
a=100;
Console.WriteLine(a);
Console.WriteLine(a.GetType());
Console.WriteLine(a.ToString());
a=new obj_Sample_Class();
obj_Sample_Class classRef;
classRef=(obj_Sample_Class)a;
Console.WriteLine(classRef.i);
}
}
输出的结果为:
100
System.Int32
100
10
请问GetType()和ToString()是什么意思啊?
谢谢拉