Dr_Max_Experience

abstract class

Jan 29th, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ООП
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.            
  10.         }
  11.     }
  12.  
  13.     abstract class Vehicle
  14.     {
  15.         protected float Speed;
  16.  
  17.         public abstract void Move();
  18.  
  19.         public float GetCurrentSpeed()
  20.         {
  21.             return Speed;
  22.         }
  23.     }
  24.  
  25.     class Car : Vehicle
  26.     {
  27.         public override void Move()
  28.         {
  29.             Console.WriteLine("Машина двигается");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment