1 2 3 4 5 6 7 8 9

A class controlsaccess 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
inheritingcertain properties from a base
class to a
derivedclass.


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, eigenvalueis 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).

8 March, 1998

Page {PAGE }

TAM/DS