Memory allocation for a class that has deep inheritance in .NET

后端 未结 3 775
南旧
南旧 2021-02-10 02:26

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         


        
3条回答
  •  天命终不由人
    2021-02-10 03:20

    The inheritance extends the Type and does not create instances. You have one single instance of E that includes the data defined by A, B, C, D and E. It provides methods and property accessors defined by these classes and the interfaces X, Y, and Z.

提交回复
热议问题