programming:継承時のコンストラクタ呼び出し
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
programming:継承時のコンストラクタ呼び出し [2017/08/09 04:43] – dot | programming:継承時のコンストラクタ呼び出し [2017/08/09 04:48] (現在) – dot | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | |||
+ | ====== 実行結果 ====== | ||
+ | |||
+ | <code sh> | ||
+ | $ dotnet run | ||
+ | This is SuperClassSample Constructor.Argument is 1234 | ||
+ | This is ChildClassSample Constructor. | ||
+ | </ | ||
+ | |||
+ | ====== ソース ====== | ||
行 26: | 行 36: | ||
{ | { | ||
// we need " | // we need " | ||
- | public ChildClassSample() : base(1) | + | public ChildClassSample() : base(1234) |
{ | { | ||
Console.WriteLine(" | Console.WriteLine(" | ||
行 34: | 行 44: | ||
</ | </ | ||
- | <code sh> | + | |
- | $ dotnet run | + | |
- | This is SuperClassSample Constructor.Argument is 1 | + | |
- | This is ChildClassSample Constructor. | + | |
- | </ | + |
programming/継承時のコンストラクタ呼び出し.1502253819.txt.gz · 最終更新: 2017/08/09 04:43 by dot