Inheritance Limitations and Interfaces Implementation

As for other built-in value types, structures implicitly inherit from the System.ValueType type that inherits from System.Object. This is the only inheritance level allowed for structures. This means that, different from reference types (classes), structures can neither inherit nor derive from other structures; therefore, the Inherits keyword is not allowed within structures. Because structures derive from System.Object, they inherit only from such class as the Equals, GetHashCode, and ToString methods that can also be overridden within structures. Chapter 12, “Inheritance,” provides detailed information on inheritance and overriding. Structures can instead implement interfaces; therefore, the Implements keyword is enabled. Chapter 13, “Interfaces” discusses interfaces.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.14.118