Advertisement
Dr_Max_Experience

Interface

Jan 29th, 2022
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ООП
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             IMovable movable = new Car();
  10.         }
  11.     }
  12.  
  13.     interface IMovable
  14.     {
  15.         void Move();
  16.     }
  17.  
  18.     class Car : IMovable
  19.     {
  20.         public void Move()
  21.         {
  22.            
  23.         }
  24.     }
  25.  
  26.     class Human : IMovable
  27.     {
  28.         public void Move()
  29.         {
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement