-
-
Save rolfbjarne/8c9d4598d8e9ec2c511e to your computer and use it in GitHub Desktop.
This file contains 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 characters
using System; | |
using System.Threading; | |
class Base { | |
public Base () | |
{ | |
Console.WriteLine ("Base.ctor"); | |
ViewDidLoad (); | |
} | |
public virtual void ViewDidLoad () | |
{ | |
Console.WriteLine ("Base.ViewDidLoad"); | |
} | |
} | |
class Derived : Base { | |
public Derived () | |
{ | |
Console.WriteLine ("Derived.ctor"); | |
} | |
public override void ViewDidLoad () | |
{ | |
Console.WriteLine ("Derived.ViewDidLoad"); | |
base.ViewDidLoad (); | |
} | |
static void Main () | |
{ | |
new Derived (); | |
} | |
} | |
/* | |
* This prints: | |
Base.ctor | |
Derived.ViewDidLoad | |
Base.ViewDidLoad | |
Derived.ctor | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment