May 2012
Intermediate to advanced
679 pages
16h 56m
English
One of the salient features of OOP is to qualify data members of the class as private and public (Protected will be discussed later). Private members can be referenced only within the class and not outside i.e. in the function main or by methods of other class or independently written functions. Public data members can be referenced anywhere (by dot operator mechanism). Similarly, a public method can also be called anywhere (object_name. method_name (parameters)).
Figure 5.2 Public and private access
A private data member of a class can be referenced by the private as well as public method of that class. When ...
Read now
Unlock full access