Hello -
I have a function in a base class that I want to use the shadow'ed
member variable of the derived class. Here is the code ...
Public Class cCaptureBase
Protected Const cDummy As String = "Base"
Overridable Sub print()
Console.WriteLine(cDummy)
End Sub
End Class
Public Class cCaptureDerived
Inherits cCaptureBase
Protected Shadows Const cDummy As String = "Derived"
End Class
Sub Main()
Dim lInstance As cCaptureBase
lInstance = New cCaptureDerived
lInstance.print()
I would like print() to print the cDummy of the cCaptureDerived class.
Is there any way of doing that? I know I could override the print() in
the derived class but I would like to keep that in the base class.
This might either be something very simple or something that should not
be done in proper OO design. Any suggestions?
Thanks!
Joe