disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 17.10.4.xml
blob77ea34fb1428e971f3ae403025fad46817f6be50
1 <?xml version="1.0"?>
2 <clause number="17.10.4" title="Default constructors">
3   <paragraph>If a class contains no instance constructor declarations, a default instance constructor is automatically provided. That default constructor simply invokes the parameterless constructor of the direct base class. If the direct base class does not have an accessible parameterless instance constructor, a compile-time error occurs. If the class is abstract then the declared accessibility for the default constructor is protected. Otherwise, the declared accessibility for the default constructor is public. <note>[Note: Thus, the default constructor is always of the form <code_example><![CDATA[
4 protected C(): base() {}  
5 ]]></code_example>or <code_example><![CDATA[
6 public C(): base() {}  
7 ]]></code_example>where C is the name of the class. end note]</note> </paragraph>
8   <paragraph>
9     <example>[Example: In the example <code_example><![CDATA[
10 class Message  
11 {  
12    object sender;  
13    string text;  
14 }  
15 ]]></code_example>a default constructor is provided because the class contains no instance constructor declarations. Thus, the example is precisely equivalent to <code_example><![CDATA[
16 class Message  
17 {  
18    object sender;  
19    string text;  
20    public Message(): base() {}  
21 }  
22 ]]></code_example>end example]</example>
23   </paragraph>
24 </clause>