10.10 PRACTICAL CLASS DEFINITION
Earlier we have seen the ideal class definition. We have seen the logic behind it. However, we have studied inheritance and many new concepts thereafter. Hence, we will have to revise our definition. It has to be expressly understood that the following discussion is for either beginners or average programmers. It is not meant for serious programmers or library developers.
Here we will presume that in general, a class is likely to become a base class. We know that access specifier for attributes in ideal class definition is “private”. However, it creates problems in developing derived classes. Therefore, we should specify all attributes as “protected”. They give the security of “private” in a class. They are available ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access