If I have classes A, B, C, D, E
, and interfaces like X, Y, Z
, and model a system like:
class B : A, X
class C : B, Y
class D : C, Z
cla
It would create a single object - an instance of E - but that would include all the fields declared in the class hierarchy. (Interfaces can't declare fields, so they're irrelevant to the data within the object itself.) It's only fields (and any attributes affecting layout, admittedly) that contribute to the memory taken up by an object.
The reference to the instance of E could be "converted" to a reference of type A, B, C, D, X, Y or Z as an identity-preserving reference conversion - i.e. it would still be a reference to the same object.