日期:2014-05-18 浏览次数:20731 次
using System; using System.Collections.Generic; using System.Text; namespace 接口练习 { public interface Ivehicle { int trumpet(); } class Bike : Ivehicle { public int trumpet() { Console.WriteLine("I am bike 玲玲!"); } } class Bus : Ivehicle { public int trumpet() { Console.WriteLine("I am bus 叭叭!"); } } class Program { static void Main(string[] args) { Bike dc = new Bike(); Bus gc = new Bus(); dc.trumpet(); gc.trumpet(); Console.ReadLine(); } } }
class Bike : Ivehicle { public int trumpet() { Console.WriteLine("I am bike 玲玲!"); } } class Bus : Ivehicle { public int trumpet() { Console.WriteLine("I am bus 叭叭!"); } }