Class . . . End Class Statement
[accessmodifier] [Shadows] [inheritability] Class Name
statements
End Class
accessmodifier
optional; KeywordThe possible values of accessmodifier
are
Public
, Private
, and
Friend
Shadows
optional; KeywordIndicates that the Name
class shadows any
element of this same name in a base class
inheritability
optional; KeywordOne of the keywords, MustInherit
or
NotInheritable
, must be used.
MustInherit
specifies that objects of this class
cannot be created, but that objects of derived classes can be
created. NotInheritable
specifies that this class
cannot be used as a base class
Name
required; String literalThe name of the class
Defines a class and delimits the statements that define that class’ variables, properties, and methods.
If the Inherits
or Implements
statements appear in a class module, they must appear before any
other statements in the module. Moreover, the
Inherits
keyword must appear before the
Implements
keyword.
Within a class code block, members are declared as
Public
, Private
,
Protected
, Friend
, or
Protected
Friend
. The
Dim
keyword is equivalent to
Private
when used in class modules (but it is
equivalent to Public
in structures). Property
declarations are automatically Public
.
The Class...End
Class
construct
can include the following elements:
These items are accessible within the class but do not have scope outside of the class.
Public
variables are public properties of the
class; Public
procedures are public methods of the
class.
These are the public properties of the class. Default properties can
be declared by using the Default
keyword.