As we know .Net does not support multiple inheritance. Thus we can only inherit only one class. But every class by default inherits ‘object’ class. so why not error occurs when I inherit any other class.
For example A- Base class, B- Derived Class. When I use B:A , implicitly object class also get inherited as( I think) B:A,Object . How can it be possible if .Net does not support multiple inheritance.
No, it’s not like that – there’s only one inheritance chain, which would be:
Any one class only has one direct base class, but the inheritance chain of classes can be long.
As an example of why this isn’t the same as
Binheriting directly fromA, ifAoverridesToString, there’s no way ofBcalling the original implementation ofObject.ToString()– it can only callA‘s version (and overrideToStringitself, of course).