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 ...
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