CLASSES
A class packages data and related behavior. For example, a WorkOrder class might store data describing a customer’s work order in its properties. It could contain methods (subroutines and functions) for manipulating the work order. It might provide methods for scheduling the work, modifying the order’s requirements, and setting the order’s priority.
Here is the syntax for declaring a class:
[attribute_list] [Partial] [accessibility] [Shadows] [inheritance] _
Class name[(Of type_list)]
[Inherits parent_class]
[Implements interface]
statements
End Class
The only things that all class declarations must include are the Class clause (including the class’s name) and the End Class statement. Everything else is optional. The following code describes a valid (albeit not very interesting) class:
Class EmptyClass
End Class
The following sections describe the pieces of the general declaration in detail.
Attribute_list
The optional attribute_list is a comma-separated list of attributes that apply to the class. An attribute further refines the definition of a class to give more information to the compiler and the runtime system.
<Serializable(), Obsolete("No longer supported. Use Sku instead")> Public Class SkuNumber ... ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access