Further Understand UTS

public class MyClass / public struct MyStruct, you see: there is no base class specification. All reference type and value type inherit from System.Object implicitly in UTS. See below:

Ways to get Type of any objects:

1. To get it in compilation time: use typeof(). Example: 

Type t = typeof(MyClass);

2. To get it in runtime: use this.GetType(). Example:

MyClass t1 = new MyClass();
Type t = t1.GetType();

posted @ 2010-03-30 13:45  能巴  阅读(190)  评论(0编辑  收藏  举报