How do you declare a "MustOverride" Constant?
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.
Suggestions?
Visual Basic.NET.NET Programming
Last Comment
Javin007
8/22/2022 - Mon
Javin007
ASKER
Update: I've now found that I can make a "MustInherit" ReadOnly Property, but that still also feels hackish.