'定义接口
Public Interface MFP
Function GetName()
Sub ShowSome()
End Interface
'在类中实现接口
Public Class aPlugin
Implements MFP
Public Sub ShowSome() Implements MFP.ShowSome
MsgBox("Also hehe")
End Sub
Function GetName() Implements MFP.GetName
Return "hehe"
End Function
End Class
接口的使用:
接口里面的方法实例化:
代码中你可以写:
dim mf as mfp=new mfp()
mf=new aPlugin() "接口可能不只被一个类用到.你这时候要指定具体类
mf.showsome() "这样便调用了aPlugin()里面的showsome()方法