 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Unlike
C++, a class can be specified as public, or not. A public
|
|
class
within a library specifies which class(es) are available to
|
|
|
a
client programmer
|
|
|
|
– |
The
public keyword just has to be placed somewhere before the opening
|
|
|
brace
({) of the class body
|
|
|
– |
There
can be only one public class per compilation unit
|
|
|
|
– |
They
must be the same name as the file
|
|
|
– |
Without
the public qualifier, a class becomes “friendly”, available to the
|
|
|
other
classes in the library to which it belongs
|
|
|
– |
Classes
cannot be private or protected.
|
|
|
|
– |
If
you don’t want anyone access to a class, then make the constructors
|
|
|
private!
|
|