Skip to content

Instantly share code, notes, and snippets.

@reuke
Created February 12, 2018 10:07
Show Gist options
  • Save reuke/aa1333d91c2dc28dbf22a838040d89f9 to your computer and use it in GitHub Desktop.
Save reuke/aa1333d91c2dc28dbf22a838040d89f9 to your computer and use it in GitHub Desktop.
using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
WhosThere(new classA());
WhosThere(new classB());
Console.ReadKey();
}
static void WhosThere(dynamic someone)
{
Console.WriteLine(someone.ItsMe());
}
}
class classA
{
public string ItsMe() => "class A";
}
class classB
{
public string ItsMe() => "class B";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment