All classes implicitly extend Object because the C # standard specifies the language like this.
Ask how they are implemented, how to ask, how they implemented the fact that the void method does not return data, or how they implemented the fact that classes have properties: it's just somewhere in the compiler code (which could be a C # compiler or JIT compiler). We cannot know for sure, but we can say that whenever the compiler does not detect explicit inheritance in a class, it just works for System.Object instead. So you have to accept that Object is just a special type for the compiler.
Why you cannot do this with a custom class seems obvious: it would completely confuse the compiler over whether the class should extend Object or your own class without explicit inheritance. If he chooses the latter for each class without explicit inheritance, he in most cases introduces compilation errors or, if you are particularly unlucky, an amazing behavior that appears only at runtime. If he chose the first, and you have to explicitly choose for his classes for this, what is the point?
(The same, of course, will happen if you want to implicitly implement an interface: all classes that do not actually implement this interface will not break and will not lead to compilation errors. Or, if you are not lucky, the interface will correspond to unrelated methods in a class that have a consistent signature and cause strange behavior that you learn about when testing.)
source share