Each type of Window has a different shape and appearance. Drop-down list boxes look very different from Buttons. Clearly, every subclass of Window should implement its own DrawWindow( ) method—but so far, nothing in the Window class enforces that they must do so. To require subclasses to implement a method of their base, you need to designate that method as abstract.
You designate a
method as abstract by placing the
keyword at the beginning of the method
definition, as follows:
Public Sub DrawWindow ( )
An MustOverride method has no implementation. It creates a method
name and signature that must be implemented in all derived classes.
Furthermore, making one or more methods of any class MustOverride has
the side effect of making the class abstract; an
abstract class must be marked with
Classes marked with
MustInherit establish a base
for derived classes, but it is not legal to instantiate an object of
a class marked
MustInherit. Once you declare a
MustOverride, you prohibit the
creation of any instances of that class.
If one or more methods of the class are
MustOverride, the class definition must be marked
MustInherit, as in the following:
MustInherit Public Class Window
Thus, if you were to designate DrawWindow( ) MustOverride in the Window class, the Window class would thus become MustInherit. Then you could derive from Window, but you could not create any Window objects/instances. ...