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.)

Computer Science & Information Technology

You might also like to view...

Functions can have _____ argument(s).

A. only one B. not more than two C. as many as needed D. three or less

Computer Science & Information Technology

Using a ____________________ escape sequence at the end of an echo statement makes XHTML code easier to debug and read.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The office manager of your company has instructed you to find a solution for a problem. A new employee is being hired and her desk will be located where there is a table that is occupied by an older model fax machine and scanner. There is no room to put the table anywhere else and the table that holds the inkjet printer is too small for the other two devices. There is money in the budget if funds are necessary. What do you recommend?

A. put the fax and scanner on the floor and tell the new employee to step around them B. buy a new plotter that performs scanning and faxing functions C. replace the inkjet printer with a multifunction printer D. each day, put the fax and scanner on the desk of an absent employee

Computer Science & Information Technology

This type of tool probes ports on another system, and logs the state of the scanned ports.

A. certifier B. arping C. packet sniffer D. port scanner

Computer Science & Information Technology