Skip to content

Instantly share code, notes, and snippets.

@mandel-macaque
Last active Apr 8, 2020
Embed
What would you like to do?
class MyClass ()
{
}
class YourClass ()
{
}
static void Print(MyClass o)
{
Console.WriteLine ("My class!");
}
static void Print(YourClass o)
{
Console.WriteLine ("Your class");
{
static void Main ()
{
MyClass o;
Print (o ?? new YouClass);
}
class MyClass ()
{
}
class YourClass ()
{
}
static void Print(MyClass o)
{
Console.WriteLine ("My class!");
}
static void Print(YourClass o)
{
Console.WriteLine ("Your class");
{
static void Main ()
{
MyClass o;
if (o == null)
Print(new YourClass());
else
Print (o);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment