MustInherit Class c2
Sub s1()
If TypeOf Me Is c1 Then
CType(Me, c1).s2()
End If
End Sub
End Class
Class c1
Inherits c2
Sub s2()
MsgBox("A")
End Sub
End Class
Public MustInherit Class BaseClass
Public Sub Method1()
Method2()
End Sub
Public MustOverride Sub Method2()
End Class
Public Class Child1 : Inherits BaseClass
Public Overrides Sub Method2()
Debug.Print("Implements by Child1")
End Sub
End Class
Public Class Child2 : Inherits BaseClass
Public Overrides Sub Method2()
Debug.Print("Implements by Child2")
End Sub
End Class
Sub Main()
Dim c1 As New Child1
c1.Method1()
Dim c2 As New Child2
c2.Method1()
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 16