All classes that we create inherit from the Object class without needing to explicitly declare inheritance to that class.
- How does Microsoft can make all .NET class implicitly inherit from the Object class?
- Does the compiler inject that inheritance behind the scenes?
- Can I do the same kind of thing: make all my classes inherit implicitly from a class interface for example?
My question may be ambiguous so I will clarify:
I'm not asking about inheriting from another class other than Object since I know that multiple inheritance for classes is forbidden. I'm talking about inheritance rather through class Interfaces, my question is about IMPLICITLY DOING IT not about substituting an object by another class of my own, or do multiple inheritance with Object and another class of my own. I want to get all classes inherit form Interface1OfMyOwn and Interface2OfMyOwn.