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:

Further Understand UTS_第1张图片

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();

你可能感兴趣的:(r)