-
-
Save tuannguyenssu/1b6aea9ebd9d66aefdbba8184c2f1178 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 class Dog : IAnimal | |
{ | |
public void Eat () {} | |
public void Drink () {} | |
public void Sleep () {} | |
} | |
public class Cat : IAnimal | |
{ | |
public void Eat () {} | |
public void Drink () {} | |
public void Sleep () {} | |
} | |
public interface IAnimal | |
{ | |
void Eat(); | |
... | |
void Swim(); | |
void Fly(); | |
} | |
public class Fish : IAnimal | |
{ | |
public void Eat () {} | |
... | |
public void Swim() {} | |
public void Fly() { throw new Exception("Cá éo biết bay"); } | |
} | |
public class Bird : IAnimal | |
{ | |
public void Eat () {} | |
... | |
public void Swim() { throw new Exception("Chim éo biết bơi"); } | |
public void Fly() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment