Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu
Created Jul 7, 2019
Embed
What would you like to do?
public interface IAnimal
{
void Eat();
void Drink();
void Sleep();
}
public interface IBird
{
void Fly();
}
public interface IFish
{
void Swim();
}
// Các class chỉ cần kế thừa những interface có chúc năng chúng cần
public class Dog : IAnimal
{
public void Eat() {}
public void Drink() {}
public void Sleep() {}
}
public class FlappyBird: IAnimal, IBird
{
public void Eat() {}
public void Drink() {}
public void Sleep() {}
public void Fly() {}
}
public class FormosaFish: IAnimal, IBird
{
public void Eat() {}
public void Drink() {}
public void Sleep() {}
public void Swim() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment