How do you declare a "MustOverride" Constant?
Posted on 2010-11-15
Okay, I'm painfully new to TRUE OOP programming, and am working with inheritance. I have a constant that I want each child class to be forced to set, so that in the base class a common method can be run that uses the value as set by its children.
I've tried the following:
Protected MustOverride Const Foo As Long
But needless to say, VB.Net no likey.
I've come to the conclusion that I can create a regular variable in the base class, then make a required sub that "sets" the value of the variable, but this definitely feels like a hack.