Mid
From PDF
OOP
C# 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
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png