Is the Type object a reference type?
Let's say I have this code:

String s = "AAA";
Type b = s.GetType();

Does b point at a type object located on heap?

How can we create a TYPE object for an abstract class?
Again this code:

String s = "AAA";
Type b = s.GetType();

How can s.GetType(); create a TYPE object if this is an abstract class? You can't create instance of abstract class.

So Object.GetType() method, return a type derived from System.Type, namely System.RuntimeType - This i understand. BUT which object returns by typeof(object)? It should be a type that also derived from System.Type, since type class itself is abstract. what the name of this type?

3

There are 3 best solutions below

2
On

You could easily get information about this on the official documentation. Please refer the docs

Type does not point to the actual objects. It just gets the information on the Type of the object.

As you cannot create an instance of an abstract class, you would not be able to invoke the GetType on that class.

5
On

The non-virtual method Object.GetType() is implemented by the .NET runtime. It returns the type info for the object it is called on.

The actual implementation of the returned Type is an implementation detail, but the .NET runtime will return a type derived from System.Type, namely System.RuntimeType. See also What's the difference between System.Type and System.RuntimeType in C#?.

Regarding your edit:

which object returns by typeof(object)?

typeof(T) gets compiled to Type.GetTypeFromHandle(), and which Type-derived type that method returns is an implementation detail again.

I just want to know how is it possible to create a type object if type object is an abstract class?

You can't. The mscorlib library contains public abstract class System.Type, which public abstract class System.TypeInfo inherits, which in turn is inherited by internal class RuntimeType. So internally, the CLR does something like this:

public Type GetType()
{
    var typeInfo = new RuntimeType();
    // set some properties
    return typeInfo();
}

And because RuntimeType inherits from Type, an instance of that type can be returned from that method.

0
On

Does b point at a type object located on heap?

Yes, since System.Type is a reference type it is always allocated on the heap.

How can we create a TYPE object for an abstract class?

var t = typeof(MyAbstractClass);