
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
	<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head><card id="MainCard" title="&#x6B22;&#x8FCE;&#x5149;&#x4E34;"><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a><br/>&nbsp;</p><p><b>&#x6807;&#x9898;&#x3A;</b> &#x45;&#x66;&#x66;&#x65;&#x63;&#x74;&#x69;&#x76;&#x65;&#x20;&#x43;&#x23;&#x20;&#x539F;&#x5219;&#x31;&#x34;&#xFF1A;&#x4F7F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#x94FE;</p><p><b>&#x4F5C;&#x8005;&#x3A;</b> &#x64;&#x6E;&#x61;&#x77;&#x6F;</p><p><b>&#x65E5;&#x671F;&#x3A;</b> &#x32;&#x30;&#x30;&#x39;&#x2D;&#x30;&#x37;&#x2D;&#x33;&#x30;&#x20;&#x31;&#x30;&#x3A;&#x31;&#x33;&#x20;&#x50;&#x4D;</p><p><b>&#x5206;&#x7C7B;&#x3A;</b> <a href="wap.asp?do=showLog&amp;cateID=5">&#x57;&#x65;&#x62;&#x7F16;&#x7A0B;</a></p><p><b>&#x5185;&#x5BB9;&#x3A;</b> &#x5199;&#x6784;&#x9020;&#x51FD;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x53CD;&#x590D;&#x7684;&#x5DE5;&#x4F5C;&#x3002;&#x5F88;&#x591A;&#x5F00;&#x53D1;&#x4EBA;&#x5458;&#x90FD;&#x662F;&#x5148;&#x5199;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x7136;&#x540E;&#x590D;&#x5236;&#x7C98;&#x8D34;&#x5230;&#x5176;&#x5B83;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x91CC;&#xFF0C;&#x4EE5;&#x6B64;&#x6765;&#x6EE1;&#x8DB3;&#x7C7B;&#x7684;&#x4E00;&#x4E9B;&#x91CD;&#x8F7D;&#x63A5;&#x53E3;&#x3002;&#x5E0C;&#x671B;&#x4F60;&#x4E0D;&#x662F;&#x8FD9;&#x6837;&#x505A;&#x7684;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x7684;&#xFF0C;&#x5C31;&#x6B64;&#x505C;&#x6B62;&#x5427;&#x3002;&#x6709;&#x7ECF;&#x9A8C;&#x7684;C++&#x7A0B;&#x5E8F;&#x53EF;&#x80FD;&#x4F1A;&#x7528;&#x4E00;&#x4E2A;&#x8F85;&#x52A9;&#x7684;&#x79C1;&#x6709;&#x65B9;&#x6CD5;&#xFF0C;&#x628A;&#x5E38;&#x7528;&#x7684;&#x7B97;&#x6CD5;&#x653E;&#x5728;&#x91CC;&#x9762;&#x6765;&#x6784;&#x9020;&#x5BF9;&#x8C61;&#x3002;&#x4E5F;&#x8BF7;&#x505C;&#x6B62;&#x5427;&#x3002;&#x5F53;&#x4F60;&#x53D1;&#x73B0;&#x591A;&#x91CD;&#x6784;&#x9020;&#x51FD;&#x6570;&#x5305;&#x542B;&#x76F8;&#x540C;&#x7684;&#x903B;&#x8F91;&#x65F6;&#xFF0C;&#x53D6;&#x800C;&#x4EE3;&#x4E4B;&#x7684;&#x662F;&#x628A;&#x8FD9;&#x4E9B;&#x903B;&#x8F91;&#x653E;&#x5728;&#x4E00;&#x4E2A;&#x5E38;&#x7528;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x91CC;&#x3002;&#x4F60;&#x53EF;&#x4EE5;&#x5F97;&#x907F;&#x514D;&#x4EE3;&#x7801;&#x7684;&#x91CD;&#x590D;&#x7684;&#x597D;&#x5904;&#xFF0C;&#x5E76;&#x4E14;&#x6784;&#x9020;&#x51FD;&#x6570;&#x521D;&#x59CB;&#x5316;&#x6BD4;&#x5BF9;&#x8C61;&#x7684;&#x5176;&#x5B83;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x8D77;&#x6765;&#x66F4;&#x9AD8;&#x6548;&#x3002;C#&#x7F16;&#x8BD1;&#x5668;&#x628A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x521D;&#x59CB;&#x5316;&#x8BC6;&#x522B;&#x4E3A;&#x7279;&#x6B8A;&#x7684;&#x8BED;&#x6CD5;&#xFF0C;&#x5E76;&#x4E14;&#x79FB;&#x9664;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x4E2D;&#x91CD;&#x590D;&#x7684;&#x53D8;&#x91CF;&#x548C;&#x91CD;&#x590D;&#x7684;&#x57FA;&#x7C7B;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;&#x7ED3;&#x679C;&#x5C31;&#x662F;&#x8FD9;&#x6837;&#x7684;&#xFF0C;&#x4F60;&#x7684;&#x5BF9;&#x8C61;&#x6700;&#x7EC8;&#x6267;&#x884C;&#x6700;&#x5C11;&#x7684;&#x4EE3;&#x7801;&#x6765;&#x5408;&#x7406;&#x7684;&#x521D;&#x59CB;&#x5316;&#x5BF9;&#x8C61;&#x3002;&#x4F60;&#x540C;&#x6837;&#x53EF;&#x4EE5;&#x5199;&#x6700;&#x5C11;&#x7684;&#x4EE3;&#x7801;&#x6765;&#x628A;&#x8D1F;&#x8D23;&#x59D4;&#x6258;&#x7ED9;&#x4E00;&#x4E2A;&#x5E38;&#x7528;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x5145;&#x8BB8;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x8C03;&#x7528;&#x53E6;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x4F8B;&#x5B50;&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;public class MyClass<br/>{<br/>&nbsp;&nbsp;// collection of data<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;// Name of the instance:<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass() :<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( 0, &#34;&#34; )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount ) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( initialCount, &#34;&#34; )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = ( initialCount &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList( initialCount ) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>C#&#x4E0D;&#x652F;&#x6301;&#x5E26;&#x9ED8;&#x8BA4;&#x503C;&#x7684;&#x53C2;&#x6570;&#xFF0C;C++&#x662F;&#x5F88;&#x597D;&#x7684;&#x89E3;&#x51B3;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x7684;(&#x8BD1;&#x6CE8;&#xFF1A;C++&#x53EF;&#x4EE5;&#x8BA9;&#x53C2;&#x6570;&#x6709;&#x9ED8;&#x8BA4;&#x7684;&#x503C;&#xFF0C;&#x4ECE;&#x800C;&#x6709;&#x6548;&#x7684;&#x51CF;&#x5C11;&#x51FD;&#x6570;&#x7684;&#x91CD;&#x8F7D;)&#x3002;&#x4F60;&#x5FC5;&#x987B;&#x91CD;&#x5199;&#x6BCF;&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;&#x5BF9;&#x4E8E;&#x8FD9;&#x6837;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x5C31;&#x610F;&#x5473;&#x7740;&#x5927;&#x91CF;&#x7684;&#x4EE3;&#x7801;&#x91CD;&#x590D;&#x5DE5;&#x4F5C;&#x3002;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#x94FE;&#x6765;&#x53D6;&#x4EE3;&#x5E38;&#x89C4;&#x7684;&#x65B9;&#x6CD5;&#x3002;&#x4E0B;&#x9762;&#x5C31;&#x662F;&#x4E00;&#x4E9B;&#x5E38;&#x89C4;&#x7684;&#x4F4E;&#x6548;&#x7387;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x903B;&#x8F91;&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;public class MyClass<br/>{<br/>&nbsp;&nbsp;// collection of data<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;// Name of the instance:<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass()<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( 0, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, Name );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;private void commonConstructor( int count,<br/>&nbsp;&nbsp;&nbsp;&nbsp;string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = (count &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList(count) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>&#x8FD9;&#x4E2A;&#x7248;&#x672C;&#x770B;&#x4E0A;&#x53BB;&#x662F;&#x4E00;&#x6837;&#x7684;&#xFF0C;&#x4F46;&#x751F;&#x6210;&#x7684;&#x6548;&#x7387;&#x8FDC;&#x4E0D;&#x53CA;&#x5BF9;&#x8C61;&#x7684;&#x5176;&#x5B83;&#x4EE3;&#x7801;&#x3002;&#x4E3A;&#x4E86;&#x4F60;&#x7684;&#x5229;&#x76CA;&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x4E3A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6DFB;&#x52A0;&#x4E86;&#x4E00;&#x4E9B;&#x4EE3;&#x7801;&#x3002;&#x6DFB;&#x52A0;&#x4E86;&#x4E00;&#x4E9B;&#x4EE3;&#x7801;&#x6765;&#x521D;&#x59CB;&#x5316;&#x6240;&#x6709;&#x7684;&#x53D8;&#x91CF;(&#x53C2;&#x89C1;&#x539F;&#x5219;12)&#x3002;&#x5B83;&#x8FD8;&#x8C03;&#x7528;&#x4E86;&#x57FA;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;&#x5F53;&#x4F60;&#x81EA;&#x5DF1;&#x5199;&#x4E00;&#x4E9B;&#x6709;&#x6548;&#x7684;&#x51FD;&#x6570;&#x65F6;&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x5C31;&#x4E0D;&#x4F1A;&#x6DFB;&#x52A0;&#x8FD9;&#x4E9B;&#x91CD;&#x590D;&#x7684;&#x4EE3;&#x7801;&#x4E86;&#x3002;&#x7B2C;&#x4E8C;&#x4E2A;&#x7248;&#x672C;&#x7684;IL&#x4EE3;&#x7801;&#x548C;&#x4E0B;&#x9762;&#x5199;&#x7684;&#x662F;&#x4E00;&#x6837;&#x7684;&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;// Not legal, illustrates IL generated:<br/>public MyClass()<br/>{<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass( )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( 0, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass (int initialCount)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, Name );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;private void commonConstructor( int count,<br/>&nbsp;&nbsp;&nbsp;&nbsp;string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = (count &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList(count) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>&#x5982;&#x679C;&#x4F60;&#x7528;&#x7B2C;&#x4E00;&#x4E2A;&#x7248;&#x672C;&#x5199;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x5728;&#x7F16;&#x8BD1;&#x770B;&#x6765;&#xFF0C;&#x4F60;&#x662F;&#x8FD9;&#x6837;&#x5199;&#x7684;&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;// Not legal, illustrates IL generated:<br/>public MyClass()<br/>{<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass( )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// No variable initializers here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Call the third constructor, shown below.<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( 0, &#34;&#34; ); // Not legal, illustrative only.<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass (int initialCount)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// No variable initializers here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Call the third constructor, shown below.<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;_counter = initialCount;<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = Name;<br/>&nbsp;&nbsp;}<br/>}<br/>&#x4E0D;&#x540C;&#x4E4B;&#x5904;&#x5C31;&#x662F;&#x7F16;&#x8BD1;&#x5668;&#x6CA1;&#x6709;&#x751F;&#x6210;&#x5BF9;&#x57FA;&#x7C7B;&#x7684;&#x591A;&#x91CD;&#x8C03;&#x7528;&#xFF0C;&#x4E5F;&#x6CA1;&#x6709;&#x590D;&#x5236;&#x5B9E;&#x4F8B;&#x53D8;&#x91CF;&#x5230;&#x6BCF;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x5185;&#x3002;&#x5B9E;&#x9645;&#x4E0A;&#x57FA;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x53EA;&#x662F;&#x5728;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x91CC;&#x88AB;&#x8C03;&#x7528;&#x4E86;&#xFF0C;&#x8FD9;&#x540C;&#x6837;&#x5F88;&#x91CD;&#x8981;&#xFF1A;&#x4F60;&#x4E0D;&#x80FD;&#x5305;&#x542B;&#x66F4;&#x591A;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x3002;&#x5728;&#x8FD9;&#x4E2A;&#x7C7B;&#x91CC;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7528;this()&#x628A;&#x5B83;&#x59D4;&#x6258;&#x7ED9;&#x53E6;&#x4E00;&#x4E2A;&#x65B9;&#x6CD5;&#xFF0C;&#x6216;&#x8005;&#x4F60;&#x53EF;&#x4EE5;&#x7528;base()&#x8C03;&#x7528;&#x57FA;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x3002;&#x4F46;&#x4F60;&#x4E0D;&#x80FD;&#x540C;&#x65F6;&#x8C03;&#x7528;&#x4E24;&#x4E2A;&#x3002;<br/>&#x8FD8;&#x4E0D;&#x6E05;&#x695A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x5417;&#xFF1F;&#x90A3;&#x4E48;&#x8003;&#x8651;&#x4E00;&#x4E0B;&#x53EA;&#x8BFB;&#x7684;&#x5E38;&#x91CF;&#xFF0C;&#x5728;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x91CC;&#xFF0C;&#x5BF9;&#x8C61;&#x7684;&#x540D;&#x5B57;&#x5728;&#x6574;&#x4E2A;&#x751F;&#x547D;&#x671F;&#x5185;&#x90FD;&#x4E0D;&#x5E94;&#x8BE5;&#x6539;&#x53D8;&#x3002;&#x8FD9;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;&#x4F60;&#x5E94;&#x8BE5;&#x628A;&#x5B83;&#x8BBE;&#x7F6E;&#x4E3A;&#x53EA;&#x8BFB;&#x7684;&#x3002;&#x5982;&#x679C;&#x4F7F;&#x7528;&#x8F85;&#x52A9;&#x51FD;&#x6570;&#x6765;&#x6784;&#x9020;&#x5BF9;&#x8C61;&#x5C31;&#x4F1A;&#x5F97;&#x5230;&#x4E00;&#x4E2A;&#x7F16;&#x8BD1;&#x9519;&#x8BEF;&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;public class MyClass<br/>{<br/>&nbsp;&nbsp;// collection of data<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;// Number for this instance<br/>&nbsp;&nbsp;private int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _counter;<br/>&nbsp;&nbsp;// Name of the instance:<br/>&nbsp;&nbsp;private readonly string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass()<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( 0, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, Name );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;private void commonConstructor( int count,<br/>&nbsp;&nbsp;&nbsp;&nbsp;string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = (count &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList(count) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;// ERROR changing the name outside of a constructor.<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>C++&#x7A0B;&#x5E8F;&#x4F1A;&#x628A;&#x8FD9;&#x4E2A;_name&#x7559;&#x5728;&#x6BCF;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x91CC;&#xFF0C;&#x6216;&#x8005;&#x901A;&#x5E38;&#x662F;&#x5728;&#x8F85;&#x52A9;&#x51FD;&#x6570;&#x91CC;&#x628A;&#x5B83;&#x4E22;&#x6389;&#x3002;C#&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x597D;&#x7684;&#x9009;&#x62E9;&#xFF0C;&#x51E0;&#x4E4E;&#x6240;&#x6709;&#x7684;&#x7410;&#x788E;&#x7684;&#x7C7B;&#x90FD;&#x5305;&#x542B;&#x4E0D;&#x53EA;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x5B83;&#x4EEC;&#x7684;&#x5DE5;&#x4F5C;&#x5C31;&#x662F;&#x521D;&#x59CB;&#x5316;&#x5BF9;&#x8C61;&#x7684;&#x6240;&#x6709;&#x6210;&#x5458;&#x53D8;&#x91CF; &#x3002;&#x8FD9;&#x662F;&#x5F88;&#x5E38;&#x89C1;&#x7684;&#xFF0C;&#x8FD9;&#x4E9B;&#x51FD;&#x6570;&#x5728;&#x7406;&#x60F3;&#x60C5;&#x51B5;&#x4E0B;&#x6709;&#x76F8;&#x4F3C;&#x7684;&#x5171;&#x4EAB;&#x903B;&#x8F91;&#x7ED3;&#x6784;&#x3002;&#x4F7F;&#x7528;C#&#x6784;&#x9020;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x6765;&#x751F;&#x6210;&#x8FD9;&#x4E9B;&#x5E38;&#x89C4;&#x7684;&#x7B97;&#x6CD5;&#xFF0C;&#x8FD9;&#x6837;&#x5C31;&#x53EA;&#x7528;&#x5199;&#x4E00;&#x6B21;&#x4E5F;&#x53EA;&#x6267;&#x884C;&#x4E00;&#x6B21;&#x3002;<br/>&#x8FD9;&#x662F;C#&#x91CC;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5173;&#x4E8E;&#x5BF9;&#x8C61;&#x6784;&#x9020;&#x7684;&#x539F;&#x5219;&#xFF0C;&#x662F;&#x65F6;&#x5019;&#x590D;&#x4E60;&#x4E00;&#x4E0B;&#xFF0C;&#x4E00;&#x4E2A;&#x7C7B;&#x578B;&#x5728;&#x6784;&#x9020;&#x65F6;&#x7684;&#x6574;&#x4E2A;&#x4E8B;&#x4EF6;&#x987A;&#x5E8F;&#x4E86;&#x3002;&#x4F60;&#x987B;&#x8981;&#x540C;&#x65F6;&#x660E;&#x767D;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x64CD;&#x4F5C;&#x987A;&#x5E8F;&#x548C;&#x9ED8;&#x8BA4;&#x7684;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x7684;&#x987A;&#x5E8F;&#x3002;&#x4F60;&#x6784;&#x9020;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x4F60;&#x5E94;&#x8BE5;&#x52AA;&#x529B;&#x4F7F;&#x6240;&#x6709;&#x7684;&#x6210;&#x5458;&#x53D8;&#x91CF;&#x53EA;&#x7CBE;&#x786E;&#x7684;&#x521D;&#x59CB;&#x5316;&#x4E00;&#x6B21;&#x3002;&#x6700;&#x597D;&#x7684;&#x5B8C;&#x6210;&#x8FD9;&#x4E2A;&#x76EE;&#x6807;&#x7684;&#x65B9;&#x6CD5;&#x5C31;&#x662F;&#x5C3D;&#x5FEB;&#x7684;&#x5B8C;&#x6210;&#x53D8;&#x91CF;&#x7684;&#x521D;&#x59CB;&#x5316;&#x3002;&#x8FD9;&#x662F;&#x67D0;&#x4E2A;&#x7C7B;&#x578B;&#x7B2C;&#x4E00;&#x6B21;&#x6784;&#x9020;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x65F6;&#x7684;&#x987A;&#x5E8F;&#xFF1A;<br/>1. &#x9759;&#x6001;&#x53D8;&#x91CF;&#x5B58;&#x50A8;&#x4F4D;&#x7F6E;0&#x3002;<br/>2. &#x9759;&#x6001;&#x53D8;&#x91CF;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x6267;&#x884C;&#x3002;<br/>3. &#x57FA;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6267;&#x884C;&#x3002;<br/>4. &#x9759;&#x6001;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6267;&#x884C;&#x3002;<br/>5. &#x5B9E;&#x4F8B;&#x53D8;&#x91CF;&#x5B58;&#x50A8;&#x4F4D;&#x7F6E;0&#x3002;<br/>6. &#x5B9E;&#x4F8B;&#x53D8;&#x91CF;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x6267;&#x884C;&#x3002;<br/>7. &#x6070;&#x5F53;&#x7684;&#x57FA;&#x7C7B;&#x5B9E;&#x4F8B;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6267;&#x884C;&#x3002;<br/>8. &#x5B9E;&#x4F8B;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6267;&#x884C;&#x3002;<br/>&#x540E;&#x7EED;&#x7684;&#x540C;&#x6837;&#x7C7B;&#x578B;&#x7684;&#x5B9E;&#x4F8B;&#x4ECE;&#x7B2C;5&#x6B65;&#x5F00;&#x59CB;&#xFF0C;&#x56E0;&#x4E3A;&#x7C7B;&#x7684;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x53EA;&#x6267;&#x884C;&#x4E00;&#x6B21;&#x3002;&#x540C;&#x6837;&#xFF0C;&#x7B2C;6&#x548C;&#x7B2C;7&#x6B65;&#x662F;&#x4F18;&#x5316;&#x4E86;&#x7684;&#xFF0C;&#x5B83;&#x53EF;&#x4EE5;&#x8BA9;&#x7F16;&#x8BD1;&#x5668;&#x5728;&#x6784;&#x9020;&#x51FD;&#x6570;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x4E0A;&#x79FB;&#x9664;&#x91CD;&#x590D;&#x7684;&#x6307;&#x4EE4;&#x3002;<br/>C#&#x7684;&#x7F16;&#x8BD1;&#x5668;&#x4FDD;&#x8BC1;&#x6240;&#x6709;&#x7684;&#x4E8B;&#x7269;&#x5728;&#x521D;&#x59CB;&#x5316;&#x4F7F;&#x7528;&#x540C;&#x6837;&#x7684;&#x65B9;&#x6CD5;&#x6765;&#x751F;&#x6210;&#x3002;&#x81F3;&#x5C11;&#xFF0C;&#x4F60;&#x5E94;&#x8BE5;&#x4FDD;&#x8BC1;&#x5728;&#x4F60;&#x7684;&#x7C7B;&#x578B;&#x521B;&#x5EFA;&#x65F6;&#xFF0C;&#x5BF9;&#x8C61;&#x5360;&#x7528;&#x7684;&#x6240;&#x6709;&#x5185;&#x5B58;&#x662F;&#x5DF2;&#x7ECF;&#x7F6E;0&#x7684;&#x3002;&#x5BF9;&#x9759;&#x6001;&#x6210;&#x5458;&#x548C;&#x5B9E;&#x4F8B;&#x6210;&#x5458;&#x90FD;&#x662F;&#x4E00;&#x6837;&#x7684;&#x3002;&#x4F60;&#x7684;&#x76EE;&#x6807;&#x5C31;&#x662F;&#x786E;&#x4FDD;&#x4F60;&#x5E0C;&#x671B;&#x6267;&#x884C;&#x7684;&#x521D;&#x59CB;&#x5316;&#x4EE3;&#x7801;&#x53EA;&#x6267;&#x884C;&#x4E00;&#x6B21;&#x3002;&#x4F7F;&#x7528;&#x9884;&#x7F6E;&#x65B9;&#x6CD5;&#x6765;&#x521D;&#x59CB;&#x5316;&#x7B80;&#x5355;&#x7684;&#x8D44;&#x6E90;&#xFF0C;&#x4F7F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6765;&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E9B;&#x5177;&#x6709;&#x590D;&#x6742;&#x903B;&#x8F91;&#x7ED3;&#x6784;&#x7684;&#x6210;&#x5458;&#x3002;&#x540C;&#x6837;&#xFF0C;&#x4E3A;&#x4E86;&#x51CF;&#x5C11;&#x91CD;&#x590D;&#x5C3D;&#x53EF;&#x80FD;&#x7684;&#x7EC4;&#x7EC7;&#x8C03;&#x7528;&#x5176;&#x5B83;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;<br/>========================================================&nbsp;&nbsp;&nbsp;&nbsp;<br/>Item 14: Utilize Constructor Chaining<br/>Writing constructors is often a repetitive task. Many developers write the first constructor and then copy and paste the code into other constructors, to satisfy the multiple overrides defined in the class interface. Hopefully, you&#39;re not one of those. If you are, stop it. Veteran C++ programmers would factor the common algorithms into a private helper method. Stop that, too. When you find that multiple constructors contain the same logic, factor that logic into a common constructor instead. You&#39;ll get the benefits of avoiding code duplication, and constructor initializers generate much more efficient object code. The C# compiler recognizes the constructor initializer as special syntax and removes the duplicated variable initializers and the duplicated base class constructor calls. The result is that your final object executes the minimum amount of code to properly initialize the object. You also write the least code by delegating responsibilities to a common constructor.<br/>Constructor initializers allow one constructor to call another constructor. This example shows a simple usage:<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;public class MyClass<br/>{<br/>&nbsp;&nbsp;// collection of data<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;// Name of the instance:<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass() :<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( 0, &#34;&#34; )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount ) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( initialCount, &#34;&#34; )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = ( initialCount &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList( initialCount ) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>C# does not support default parameters, which would be the preferred C++ solution to this problem. You must write each constructor that you support as a separate function. With constructors, that can mean a lot of duplicated code. Use constructor chaining instead of creating a common utility routine. Several inefficiencies are present in this alt&#101;rnative method of factoring out common constructor logic: <br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;public class MyClass<br/>{<br/>&nbsp;&nbsp;// collection of data<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;// Name of the instance:<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass()<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( 0, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, Name );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;private void commonConstructor( int count,<br/>&nbsp;&nbsp;&nbsp;&nbsp;string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = (count &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList(count) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>That version looks the same, but it generates far less efficient object code. The compiler adds code to perform several functions on your behalf in constructors. It adds statements for all variable initializers (see Item 12). It calls the base class constructor. When you write your own common utility function, the compiler cannot factor out this duplicated code. The IL for the second version is the same as if you&#39;d written this:<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;// Not legal, illustrates IL generated:<br/>public MyClass()<br/>{<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass( )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( 0, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass (int initialCount)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, Name );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;private void commonConstructor( int count,<br/>&nbsp;&nbsp;&nbsp;&nbsp;string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = (count &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList(count) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>If you could write the construction code for the first version the way the compiler sees it, you&#39;d write this:<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;// Not legal, illustrates IL generated:<br/>public MyClass()<br/>{<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;private string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass( )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// No variable initializers here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Call the third constructor, shown below.<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( 0, &#34;&#34; ); // Not legal, illustrative only.<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass (int initialCount)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// No variable initializers here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Call the third constructor, shown below.<br/>&nbsp;&nbsp;&nbsp;&nbsp;this( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;// Instance Initializers would go here.<br/>&nbsp;&nbsp;&nbsp;&nbsp;object(); // Not legal, illustrative only.<br/>&nbsp;&nbsp;&nbsp;&nbsp;_counter = initialCount;<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = Name;<br/>&nbsp;&nbsp;}<br/>}<br/>The difference is that the compiler does not generate multiple calls to the base class constructor, nor does it copy the instance variable initializers into each constructor body. The fact that the base class constructor is called only from the last constructor is also significant: You cannot include more than one constructor initializer in a constructor definition. You can delegate to another constructor in this class using this(), o&#114; you can call a base class constructor using base(). You cannot do both.<br/>Still don&#39;t buy the case for constructor initializers? Then think about read-only constants. In this example, the name of the object should not change during its lifetime. This means that you should make it read-only. That causes the common utility function to generate compiler errors:<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;public class MyClass<br/>{<br/>&nbsp;&nbsp;// collection of data<br/>&nbsp;&nbsp;private ArrayList _coll;<br/>&nbsp;&nbsp;// Number for this instance<br/>&nbsp;&nbsp;private int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _counter;<br/>&nbsp;&nbsp;// Name of the instance:<br/>&nbsp;&nbsp;private readonly string&nbsp;&nbsp;_name;<br/>&nbsp;&nbsp;public MyClass()<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( 0, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, &#34;&#34; );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;public MyClass( int initialCount, string Name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;commonConstructor( initialCount, Name );<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;private void commonConstructor( int count,<br/>&nbsp;&nbsp;&nbsp;&nbsp;string name )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;_coll = (count &gt; 0 ) ?<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList(count) :<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new ArrayList();<br/>&nbsp;&nbsp;&nbsp;&nbsp;// ERROR changing the name outside of a constructor.<br/>&nbsp;&nbsp;&nbsp;&nbsp;_name = name;<br/>&nbsp;&nbsp;}<br/>}<br/>C++ programmers just live with this and initialize _name in all constructors, o&#114; they cast away constness in the utility routine. C#&#39;s constructor initializers provide a better alt&#101;rnative. All but the most trivial classes contain more than one constructor. Their job is to initialize all the members of an object. By their very nature, these functions have similar o&#114;, ideally, shared logic. Use the C# constructor initializer to factor out those common algorithms so that you write them once and they execute once.<br/>This is the last item about object initialization in C#. That makes it a good time to review the entire sequence of events for constructing an instance of a type. You should understand both the o&#114;der of operations and the default initialization of an object. You should strive to initialize every member variable exactly once during construction. The best way for you to accomplish this is to initialize values as early as possible. Here is the o&#114;der of operations for constructing the first instance of a type:<br/>1. Static variable storage is set to 0.<br/>2. Static variable initializers execute.<br/>3. Static constructors for the base class execute.<br/>4. The static constructor executes.<br/>5. Instance variable storage is set to 0.<br/>6. Instance variable initializers execute.<br/>7. The appropriate base class instance constructor executes.<br/>8. The instance constructor executes.<br/>Subsequent instances of the same type start at step 5 because the class initializers execute only once. Also, steps 6 and 7 are optimized so that constructor initializers cause the compiler to remove duplicate instructions.<br/>The C# language compiler guarantees that everything gets initialized in some way when an object gets cr&#101;ated. At a minimum, you are guaranteed that all memory your object uses has been set to 0 when an instance is cr&#101;ated. This is true for both static members and instance members. Your goal is to make sure that you initialize all the values the way you want and execute that initialization code only once. Use initializers to initialize simple resources. Use constructors to initialize members that require more sophisticated logic. Also factor calls to other constructors, to minimize duplication.</p><p> + <a href="#CommentCard">&#x67E5;&#x770B;&#x5F53;&#x524D;&#x65E5;&#x5FD7;&#x8BC4;&#x8BBA;</a> (0)</p><p>&nbsp;<br/><br/><a href="wap.asp?do=Login">&#x767B;&#x5F55;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.738&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="postCommentCard"><p><b>&#x6807;&#x9898;&#x3A;</b> <a href="#MainCard">&#x45;&#x66;&#x66;&#x65;&#x63;&#x74;&#x69;&#x76;&#x65;&#x20;&#x43;&#x23;&#x20;&#x539F;&#x5219;&#x31;&#x34;&#xFF1A;&#x4F7F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#x94FE;</a></p><p><br/>你没有权限发表评论</p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.738&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="CommentCard"><p>&#x6682;&#x65E0;&#x8BC4;&#x8BBA;</p><p><a href="#MainCard">&#x8FD4;&#x56DE;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.738&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card>
</wml>
