December 2017
Beginner to intermediate
470 pages
12h 29m
English
Objects must be defined in some way so that we can generate specific instances from them. The most common way to provide those definitions is through classes. A class is a piece of code that provides the definition for an object, including the behavior it offers in response to messages from other objects, as well as the internal data it needs to provide that behavior. The behavior for a class is implemented in its methods. More on this in the next section.
Classes must be created at some point, and that's where constructors come into play. The vast majority of the time, when you create an instance of a class, you will want it to contain some data about itself. That data is assigned to the class when it's created through ...