-
-
Save tuannguyenssu/30dcac6ae834eb894f63e1d223abe021 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
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