Let's start with objects. An object is a
computing unit organized around a collection of state
or instance variables that define the state of
the object. In addition, each object has associated
with it a set operations or methods that
operate on such state. So what that means
is that operations and methods read and write
instance variables. And in traditional object orientation, we say
that operations are invoked by sending a message
to the appropriate object, which is what we call
normally a method implication. So now that we define
what an object is, state variables, or attributes, and
operations or methods, let's see what a class is.
A class is basically a template. A blueprint, if
you wish, from which new objects, which is what
we call instances of the class can be created.
And notice that the fact of having a blueprint for
objects that allows us to create as many objects as
we want can further reuse, and also contribute to make
the code more readable, understandable,
and therefore ultimately more maintainable.