Created
September 28, 2018 01:03
-
-
Save bayological/4739df2f259c6d2ebc6e27c686829cf6 to your computer and use it in GitHub Desktop.
Animal classes and interfaces
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
namespace LongRunningApp.Animals | |
{ | |
public interface ICow | |
{ | |
void Speak(); | |
} | |
public class Cow : ICow | |
{ | |
public void Speak() | |
{ | |
Console.WriteLine("Moo"); | |
} | |
} | |
public interface ICat | |
{ | |
void Speak(); | |
} | |
public class Cat : ICat | |
{ | |
public void Speak() | |
{ | |
Console.WriteLine("Meow"); | |
} | |
} | |
public interface IMouse | |
{ | |
void Speak(); | |
} | |
public class Mouse : IMouse | |
{ | |
public void Speak() | |
{ | |
Console.WriteLine("Click"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment