Imports System
Class baseClass
Public Overridable Sub testMethod()
Console.WriteLine("Base class string")
End Sub
Public Sub useMe()
' The following call uses the calling class's method, even if
' that method is an override.
Me.testMethod()
Public Sub useMyClass()
' The following call uses this instance's method and not any
' override.
MyClass.testMethod()
End Class
Class derivedClass : Inherits baseClass
Public Overrides Sub testMethod()
Console.WriteLine("Derived class string")
Public Module Module1
Public Sub Main()
Dim testObj As derivedClass = New derivedClass()
' The following call displays "Derived class string".
testObj.useMe()
' The following call displays "Base class string".
testObj.useMyClass()
End Module