Inheritance Limitations and Interface 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 classes such 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, ...
Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.