Created
February 12, 2018 10:07
-
-
Save reuke/aa1333d91c2dc28dbf22a838040d89f9 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; | |
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