Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface IHuman
- {
- void chlen(); // контракт
- }
- class Bodyan: IHuman
- {
- public void chlen() // реализация контракта обязательна
- {
- Console.WriteLine("U menya chlen 11 cm!!!");
- }
- }
- class Telka: IHuman
- {
- public void chlen()// реализация контракта обязательна
- {
- Console.WriteLine("U menya net chlena :ccc");
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- IHuman humanus = new Telka(); // контейнер, может принимать конструктор new Bodyan()
- humanus.chlen();
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement