previous
|
start
|
next
Interface
The first member function is a
constructor
: the function that is used to initialize new objects.
This constructor has no parameters so it is called a
default constructor
.
Default constructors are automatically used when you construct an object without parameters.
Product best; /* default construction */
Every class should have a default constructor.
The
read()
member function is a
mutator function
- an operation that modifies the object.
The last two member functions are
accessor functions
- functions that query the object for some information without changing it.
The keyword
const
indicates that the implicit parameter object is not modified by the member function.
previous
|
start
|
next