At this point in the class, all we have seen are variables and types. We’ll look at “classes” very briefly here, so we can become familiar with the concept before we truly exploit it.
A class defines a new type. Like
int is a type, we can create our
own type, maybe called
Person. (We typically capitalize types that
we create with classes.) Class types are always built out of other
types; you can think of a class as a composite of other types.
For example, here we define the
Once we have defined the class, we can create objects of that
type. In this case, the class is
Person (a general idea or
classification) and each object will represent some particular
Classes will appear again in the function lecture notes where we’ll add functions inside the classes.