Player player = new Player();player.play("C D E F G A B")
class Program { static void Main(string[] args) { testInterface tc = new testClass(); tc.DoSomthing(); tc.DoSomethingElse(); } } interface testInterface { void DoSomthing(); void DoSomthingElse(string test); // compilation error.... } static class testInterfaceDefaultBehaviour { public static void DoSomethingElse(this testInterface ti) { System.Console.WriteLine("Doing something else"); } } class testClass : testInterface { public void DoSomthing() { System.Console.WriteLine("Doing something here..."); } }
" In effect, extension methods make it possible to extend existing types and constructed types with additional methods."
Subscribe to RSS headline updates from: