using System;
public class Car
{
private string make;
protected string model;
public Car(string make, string model)
{
this.make = make;
this.model = model;
}
public virtual void Start()
{
startCar();
System.Console.WriteLine("Vehicle started");
}
private void startCar()
{
System.Console.WriteLine("Turning starter motor...");
}
}
public class MyFirstCar : Car
{
public MyFirstCar(string make, string model) : base(make, model)
{
}
public override void Start()
{
Console.WriteLine("Starting " + model);
base.Start();
}
}
class MainClass
{
public static void Main()
{
MyFirstCar myCar = new MyFirstCar("Toyota", "MR2");
myCar.Start();
}
}
Starting MR2
Turning starter motor...
Vehicle started