May 2012
Intermediate to advanced
679 pages
16h 56m
English
The second method of deriving from the base class is by using keyword private (in place of public). Such derivation is termed as a private derivation. Now the derived class definition would look like:
class Clock : private Time0 { private : char strg[5]; // for AM PM public : void setAMPM(); } ;
When we define clock in this way, following things happen:
The public methods become private methods.
The public data members become private member.
As members of Time0, like hr, min and sec become private, they are not accessible outside the derived class. You will be able to see or modify them, only from methods of derived class.
The summary of the access of the base class members in the privately derived class ...
Read now
Unlock full access