Mid OOP

How is inheritance implemented in C#?

  • Using the colon (:) symbol.
  • Derived class can access public/protected members of the base class.

class Vehicle { public void Start() => Console.WriteLine("Start"); }

class Car : Vehicle { }

Car myCar = new Car();

myCar.Start(); // Inherited method

More from C# Programming Tutorial

All questions for this course