Defining Structures and Classes
We know that classes are reference types and structures are value types, literally derived from the System.ValueType. We also know that structures have replaced the type construct from VB6. What may not be so obvious is that both classes and structures support fields, properties, methods, constructors, and events. It also may not be immediately apparent that structures support only private or public members.
The structure is more like the C or C++ struct construct than it is like the VB6 type construct. However, because the VB6 type construct no longer exists, structure is the closest (and intended) replacement.
This section demonstrates how to declare each type of member that you can define in structures and classes. ...
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