Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created November 20, 2009 16:05
Show Gist options
  • Save jcromartie/239582 to your computer and use it in GitHub Desktop.
Save jcromartie/239582 to your computer and use it in GitHub Desktop.
using System;
class Foo {
}
class Bar : Foo {
}
class Program {
static void Greet(Foo f) {
Console.WriteLine("Hello, Foo");
}
static void Greet(Bar b) {
Console.WriteLine("Hello, Bar");
}
static void Main(string[] argv) {
var f = new Foo();
var b = new Bar();
Greet(f);
Greet(b);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment