/// <summary> /// This is the true power of interfaces. This method has a "arguement type" or "parameter type" /// if IPhone. This means that ANY phone that implements the IPhone interface can be sent to this /// method. The same thing will happen for all phones, and this method does not care what kind of /// specific phone it is. Nor does it care how it does the things that it is doing. /// </summary> /// <param name="phone"></param> static private void DoPhoneStuff(IPhone phone) { phone.Dial(); phone.PlayGame(); phone.Ring(); Console.WriteLine(); }
public void Play() { var info = iPhone.PlayGame("小明"); Console.WriteLine(info); }