Method modifiers are used in the following ways:
Shared
modifier indicates the method is a shared method. A shared method does not operate on a specific instance of a type. Other than within standard modules, a method declared without a Shared
modifier is called an instance method. An instance method operates on a given instance of a type. A shared method may not be overridable and may not specify Overridable
, NotOverridable
, MustOverride
or Overrides
.Overridable
modifier indicates the method is overridable. A overridable method may not specify Shared
, or NotOverridable
and may not be combined with MustOverride
or Overrides
(which both imply Overridable
). Methods in final classes may not be declared overridable and overridable functions may not be Private
.NotOverridable
modifier indicates a method is final. A method that specifies NotOverridable
must also specify Overrides
and may not specify Shared
, Overridable
or MustOverride
. Final methods may not be Private
(it is redundant).MustOverride
modifier indicates the method is abstract. An abstract method may not include a method body or an End
construct, may not override another method and may only appear in an abstract type. An abstract method may not specify Shared
, Overridable
, NotOverridable
or Overrides
. Abstract methods may not be Private
.Overrides
modifier indicates a method overrides a base type overridable method with the same signature. An overriding method may not specify Shadows
, Shared
, Overridable
or MustOverride
. If there is no matching method to override, an error occurs.Overloads
modifier indicates a method overloads another method in the type. The signature of the method must be unique amongst the set of overloaded methods, else there is an error.The only modifier that a method declared in a standard module may specify is Overloads
.