tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code02:36

C# abstract classes 👻

Bro Code ↗

From the creator

C# abstract classes tutorial example explained #C# #abstract #classes using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // abstract classes = modifier that indicates missing components or incomplete implementation Car car = new Car(); Bicycle bicycle = new Bicycle(); Boat boat = new Boat(); //Vehicle vehicle = new Vehicle(); //can't create a vehicle object Console.ReadKey(); } } abstract class Vehicle { public int speed = 0; public void go() { Console.WriteLine("This vehicle is moving!"); } } class Car : Vehicle { public int wheels = 4; int maxSpeed = 500; } class Bicycle : Vehicle { public int wheels = 2; int maxSpeed = 50; } class Boat : Vehicle { public int wheels = 0; int maxSpeed = 100; } }

Published 2021-07-03 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code