欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#虛函數(shù)用法實例分析

 更新時間:2015年07月03日 12:17:49   作者:pythoner  
這篇文章主要介紹了C#虛函數(shù)用法,實例分析了C#中虛函數(shù)的功能與基本使用技巧,需要的朋友可以參考下

本文實例講述了C#虛函數(shù)用法。分享給大家供大家參考。具體如下:

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();
   }
  }
}

希望本文所述對大家的C#程序設(shè)計有所幫助。

相關(guān)文章

最新評論