C# 虚函数使用范例
using System; namespace Test2 { class Plane { public double TopSpeed() { return 300.0D; } } class Jet : Plane { public double TopSpeed() { return 900.0D; } } class Airport { static void Main(string[] args) { Plane plane = new Jet(); Console.WriteLine("planes top speed: {0}",plane.TopSpeed()); Console.ReadLine(); } } }