dimanche 3 mars 2019

How is GetType implemented in every object in C#?

I was looking at object out of curiosity, and I realized that object doesn't have a get type method. Yet it's commonly stated that every object in the language can have .GetType() called on it.

Does everything actually inherit from Type instead of object? And if thats the case how does typeof(object) / (object)val.GetType() work?





Aucun commentaire:

Enregistrer un commentaire