Why inheritance is not supported on value types ?
Value types are created in Heap memory , Inheritance is not allowed on the members which are created in Heap memory .
Since value types are created in stack memory and stack memory is limited memory. Hence inheritance is not allowed .
Struct is value type, value types are usually created in stack memory. stack memory is limited memory and not expandable hence inheritance is not allowed .
=>structs are value types. so it will store on stack memory
=>struct support interface inheritance.
=>all value types doesnot support inheritance
=>structs are implicitly sealed, so these are cannot be inherited.
Back To Top