Created
February 15, 2012 18:46
-
-
Save idavis/1838090 to your computer and use it in GitHub Desktop.
True Late Binding
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
public class Foo { | |
public void Bar() { | |
if(IsBaz()) { | |
Console.WriteLine("CRAP"); | |
} else { | |
Console.WriteLine("W00T"); | |
} | |
} | |
public bool IsBaz() { | |
return true; | |
} | |
} | |
// Get this to work: | |
Foo foo = new Foo(); // You can replace the rhs of this line | |
foo.Bar(); // should output: W00T, but will output CRAP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment