<?xml version="1.0"?>
<clause number="17.10" title="Instance constructors">
  <paragraph>An instance constructor is a member that implements the actions required to initialize an instance of a class. Instance constructors are declared using constructor-declarations: <grammar_production><name><non_terminal where="17.10">constructor-declaration</non_terminal></name> : <rhs><non_terminal where="24.2">attributes</non_terminal><opt/><non_terminal where="17.10">constructor-modifiers</non_terminal><opt/><non_terminal where="17.10">constructor-declarator</non_terminal><non_terminal where="17.10">constructor-body</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.10">constructor-modifier</non_terminal>s</name> : <rhs><non_terminal where="17.10">constructor-modifier</non_terminal></rhs><rhs><non_terminal where="17.10">constructor-modifiers</non_terminal><non_terminal where="17.10">constructor-modifier</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.10">constructor-modifier</non_terminal></name> : <rhs><keyword>public</keyword></rhs><rhs><keyword>protected</keyword></rhs><rhs><keyword>internal</keyword></rhs><rhs><keyword>private</keyword></rhs><rhs><keyword>extern</keyword></rhs></grammar_production><grammar_production><name><non_terminal where="17.10">constructor-declarator</non_terminal></name> : <rhs><non_terminal where="9.4.2">identifier</non_terminal><terminal>(</terminal><non_terminal where="17.5.1">formal-parameter-list</non_terminal><opt/><terminal>)</terminal><non_terminal where="17.10">constructor-initializer</non_terminal><opt/></rhs></grammar_production><grammar_production><name><non_terminal where="17.10">constructor-initializer</non_terminal></name> : <rhs><terminal>:</terminal><keyword>base</keyword><terminal>(</terminal><non_terminal where="14.4.1">argument-list</non_terminal><opt/><terminal>)</terminal></rhs><rhs><terminal>:</terminal><keyword>this</keyword><terminal>(</terminal><non_terminal where="14.4.1">argument-list</non_terminal><opt/><terminal>)</terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.10">constructor-body</non_terminal></name> : <rhs><non_terminal where="15.2">block</non_terminal></rhs><rhs><terminal>;</terminal></rhs></grammar_production></paragraph>
  <paragraph>A <non_terminal where="17.10">constructor-declaration</non_terminal> may include a set of attributes (<hyperlink>24</hyperlink>), a valid combination of the four access modifiers (<hyperlink>17.2.3</hyperlink>), and an extern (<hyperlink>17.5.7</hyperlink>) modifier. A constructor declaration is not permitted to include the same modifier multiple times. </paragraph>
  <paragraph>The identifier of a <non_terminal where="17.10">constructor-declarator</non_terminal> must name the class in which the instance constructor is declared. If any other name is specified, a compile-time error occurs. </paragraph>
  <paragraph>The optional <non_terminal where="17.5.1">formal-parameter-list</non_terminal> of an instance constructor is subject to the same rules as the  <non_terminal where="17.5.1">formal-parameter-list</non_terminal> of a method (<hyperlink>17.5</hyperlink>). The formal parameter list defines the signature (<hyperlink>10.6</hyperlink>) of an instance constructor and governs the process whereby overload resolution (<hyperlink>14.4.2</hyperlink>) selects a particular instance constructor in an invocation. </paragraph>
  <paragraph>Each of the types referenced in the <non_terminal where="17.5.1">formal-parameter-list</non_terminal> of an instance constructor must be at least as accessible as the constructor itself (<hyperlink>10.5.4</hyperlink>). </paragraph>
  <paragraph>The optional <non_terminal where="17.10">constructor-initializer</non_terminal> specifies another instance constructor to invoke before executing the statements given in the <non_terminal where="17.10">constructor-body</non_terminal> of this instance constructor. This is described further in <hyperlink>17.10.1</hyperlink>. </paragraph>
  <paragraph>When a constructor declaration includes an extern modifier, the constructor is said to be an external constructor. </paragraph>
  <paragraph>Because an external constructor declaration provides no actual implementation, its <non_terminal where="17.10">constructor-body</non_terminal> consists of a semicolon. For all other constructors, the <non_terminal where="17.10">constructor-body</non_terminal> consists of a block, which specifies the statements to initialize a new instance of the class. This corresponds exactly to the block of an instance method with a <keyword>void</keyword> return type (<hyperlink>17.5.8</hyperlink>). </paragraph>
  <paragraph>Instance constructors are not inherited. Thus, a class has no instance constructors other than those actually declared in the class. If a class contains no instance constructor declarations, a default instance constructor is automatically provided (<hyperlink>17.10.4</hyperlink>). </paragraph>
  <paragraph>Instance constructors are invoked by <non_terminal where="14.5.10.1">object-creation-expression</non_terminal>s (<hyperlink>14.5.10.1</hyperlink>) and through  <non_terminal where="17.10">constructor-initializer</non_terminal>s. </paragraph>
</clause>
