Fields

Fields are the places in which you store information to and read information from. They are declared in the form of class level variables and differ from local variables in that these are declared at the method or property level. The following code shows how simple it is to declare fields:

image

Fields can be reachable from within the class and its members, and if you specify one of the appropriate qualifiers (such as Public), they can also be reached from the external world. Inside fields you store the actual information your custom objects need.

Using Fields

With the introduction of auto-implemented properties (see next section), fields ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.