日期:2014-05-17 浏览次数:20864 次
代码入下:
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); } }