Description of the type class in C #: Https://msdn.microsoft.com/zh-cn/library/system.type (vs.80). aspx
Any object in C # has the GetType () method, and its function is the same as typeof (), which returns the type of the current object of type. X in typeof (X), must be a specific class name, type name, etc., cannot be a variable name, GetType () is a method of the base class System.Object, so only after an instance is established can it be called
The difference between the two:
1, typeof is the operator but the method
2, GetType () is a method of the base class System.Object, so only after an instance is established can it be called (after initialization)
3, typeof parameters can only be int,string,string, custom type, and cannot be an instance
4, GetType (), and typeof all return System.Type references.
5, TypeOf (): Get a class type
6. GetType (): Gets the type of an instance of class
The difference between C # typeof and GetType ()