disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 17.2.1.xml
blobb01003b55248649aceb77ed4c92c1e6a7c295c35
1 <?xml version="1.0"?>
2 <clause number="17.2.1" title="Inheritance">
3   <paragraph>A class inherits the members of its direct base class. Inheritance means that a class implicitly contains all members of its direct base class, except for the instance constructors, destructors, and static constructors of the base class. Some important aspects of inheritance are: <list><list_item> Inheritance is transitive. If C is derived from B, and B is derived from A, then C inherits the members declared in B as well as the members declared in A. </list_item><list_item> A derived class extends its direct base class. A derived class can add new members to those it inherits, but it cannot remove the definition of an inherited member. </list_item><list_item> Instance constructors, destructors, and static constructors are not inherited, but all other members are, regardless of their declared accessibility (<hyperlink>10.5</hyperlink>). However, depending on their declared accessibility, inherited members might not be accessible in a derived class. </list_item><list_item> A derived class can hide (<hyperlink>10.7.1.2</hyperlink>) inherited members by declaring new members with the same name or signature. Note however that hiding an inherited member does not remove that member-it merely makes that member inaccessible in the derived class. </list_item><list_item> An instance of a class contains a set of all instance fields declared in the class and its base classes, and an implicit conversion (<hyperlink>13.1.4</hyperlink>) exists from a derived class type to any of its base class types. Thus, a reference to an instance of some derived class can be treated as a reference to an instance of any of its base classes. </list_item><list_item> A class can declare virtual methods, properties, and indexers, and derived classes can override the implementation of these function members. This enables classes to exhibit polymorphic behavior wherein the actions performed by a function member invocation varies depending on the run-time type of the instance through which that function member is invoked. </list_item></list></paragraph>
4 </clause>