Last active
July 30, 2020 07:31
-
-
Save ForNeVeR/7f94bbe02b9b1a6de0031fa39481ccf9 to your computer and use it in GitHub Desktop.
Revisions
-
ForNeVeR revised this gist
Jul 30, 2020 . No changes.There are no files selected for viewing
-
ForNeVeR created this gist
Jun 12, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ using System; namespace ConsoleApp5 { class Base { private int _baseField = PrintAndReturnLength("Base class field init"); protected Base() { Console.WriteLine("Base ctor"); } protected static int PrintAndReturnLength(string message) { Console.WriteLine(message); return message.Length; } } internal class Derived : Base { private int _derivedField = PrintAndReturnLength("Derived class field init"); public Derived() { Console.WriteLine("Derived ctor"); } } class Program { static void Main(string[] args) { var d = new Derived(); } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ ``` Derived class field init Base class field init Base ctor Derived ctor ```