Answer the following questions true (T) or false (F)
1. If, in a class, one uses the keyword public:, it affects only the member that immediately follows the keyword public, making this member accessible to any other function defined anywhere.
2. There is no access to private members of a class by any function defined outside the class.
1. False
Explanation: The effect of the public: keyword is from the keyword to the next private: keyword, so there is a region where anything that is there defined is public, not just a single member. The remark about access is correct.
2. True
Explanation: In a class, the all members defined after a keyword private: and before the next public: keyword are called private members. Access to private members by functions defined outside the class is prohibited. (Note: This ignores the issue of friend functions, which will be treated in a later chapter.)
You might also like to view...
In most workplaces and many homes, computers are connected to form a local ________ to facilitate sharing of equipment and to improve security
Fill in the blank(s) with correct word
The ________ key can be used to move the insertion point from one cell of a table to the next
A) F2 B) Insert C) Tab D) Enter