C Sharp (C#) - Inheritance
What will be the output of this C# code?
class Vehicle {
public virtual string GetType() {
return "Vehicle";
}
}
class Car : Vehicle {
public override string GetType() {
return "Car";
}
}
class Program {
static void Main() {
Vehicle v = new Car();
System.Console.WriteLine(v.GetType());
}
}