标签:log logs alt ima 引擎 ons 分享 images line
废话少说,直接上代码:

‘可飞行的
Public Interface IFlyable
‘开始飞行
Sub StartFlying()
End Interface
Public Class Plane
Implements IFlyable
Public Sub StartFlying() Implements IFlyable.StartFlying
Console.WriteLine("飞机打开引擎飞行")
End Sub
End Class
Public Class Bird
Implements IFlyable
Public Sub StartFlying() Implements IFlyable.StartFlying
Console.WriteLine("鸟儿展开翅膀飞行")
End Sub
End Class
Module Module1
Sub Main()
Dim f1 As IFlyable, f2 As IFlyable
f1 = New Bird()
f2 = New Plane()
Flying(f1)
Flying(f2)
Console.ReadKey()
End Sub
Public Sub Flying(ByVal aircraft As IFlyable)
aircraft.StartFlying()
End Sub
End Module
标签:log logs alt ima 引擎 ons 分享 images line
原文地址:http://www.cnblogs.com/bob-bao/p/6365608.html