Class Methods Defined

In the first chapter of Part III we defined a class as being a set of objects that share common attributes and behavior. Objects that are part of this set are known as instances of the class. You have so far learned that the attributes of a class are implemented as fields and properties. You know now that fields hold the data for an object (the object state) and properties provide controlled access to this state.

In this chapter you will look at the behavior, which is the second dimension of classes. Behavior means describing what an instance of the class (an object) can do. For example a horse can trot, jump, eat, and so on. All horses can perform these actions. The set of all the actions that the objects of a class can ...

Get Visual Basic® .NET by Example 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.