No; Multi-class inheritance (multiple inheritance) is not supported in C#.
Yes; Every type in .NET derives from Object
(directly or indirectly).
The way you are understanding this is incorrect; this is NOT multi-class inheritance. This is multi-level inheritance.
Take the following example:
class A : Object
class B : A //This is what happens = Correct = Multi-level inheritance
class B : A, Object//This is what you are thinking = Incorrect = Multi-class inheritance.
Yes, class A
derives from Object
.
Yes, class B
derives from A
; but class B
does NOT directly derive from Object
.
As class A
is derived from Object
, all exposed members of Object
are accessible to A
. As class B
is derived from A
, all exposed members of A
are accessible to B
. That is why, all exposed members of Object
are also accessible to class B
.
This way, class B
is also derived from Object
indirectly. This is multi-level inheritance.
That is why your following statement is correct:
Class B also derives from object. Every type in .NET does.
Just a slight correction:
All types in .NET are directly derived from Object
if they are not derived from another type. If they are derived from another type, then they are indirectly derived from Object
. Yes, in any case, each type is derived from Object
.