Skip to content

Instantly share code, notes, and snippets.

@bayological
Created September 28, 2018 01:03
Show Gist options
  • Save bayological/4739df2f259c6d2ebc6e27c686829cf6 to your computer and use it in GitHub Desktop.
Save bayological/4739df2f259c6d2ebc6e27c686829cf6 to your computer and use it in GitHub Desktop.
Animal classes and interfaces
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