SHARE
TWEET

Untitled

a guest Jul 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. interface IHuman
  2.     {
  3.         void chlen(); // контракт
  4.     }
  5.  
  6.     class Bodyan: IHuman
  7.     {
  8.         public void chlen() // реализация контракта обязательна
  9.         {
  10.             Console.WriteLine("U menya chlen 11 cm!!!");
  11.         }
  12.     }
  13.     class Telka: IHuman
  14.     {
  15.         public void chlen()// реализация контракта обязательна
  16.         {
  17.             Console.WriteLine("U menya net chlena :ccc");
  18.         }
  19.     }
  20.  
  21.     class Program
  22.     {
  23.         static void Main(string[] args)
  24.         {
  25.             IHuman humanus = new Telka(); // контейнер, может принимать конструктор new Bodyan()
  26.             humanus.chlen();
  27.             Console.ReadKey();
  28.         }
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top