A class controls access to all its member components;
thus we can precisely specify which parts of a class can be
accessed from the outside, and which parts are strictly
internal (private). The idea of hiding both data and
controlling access is very powerful.

To improve upon this idea we also have a well-defined
mechanism for inheriting certain properties from a base
class to a derived class.

From this we receive an extremely effective code re-use
mechanism. If an existing class provides certain basis
capabilities, we can incorporate them by deriving a new
class from it.

What is an object?

An object is an instance of a class.

double eigenvalue;

In this definition, eigenvalue is an instance of a double.

double is a type, it does not require memory, but eigenvalue
is an instantiation--it needs 8-bytes.

It is the same with objects. A class is a supertype, and an
object is an entity which requires memory, and is of a
certain class (in our example type).
|