Suppose we write a class and declare an object of this class in main. What happens if we use the object to call a private member function? Explain.

What will be an ideal response?


If I create an object in main, such as my Date object, i.e., Date myDate; and then attempt to access the private Date data, such as the month or year, like this: myDate.month or myDate.year, the compile will stop me and issue an error. Private data is not accessible to the world via the object

Computer Science & Information Technology

You might also like to view...

Which php.ini directive should be set to instruct PHP to store session IDs in URLs?

a. session.gc_maxlifetime b. session.cache_expire c. session.use_trans_sid d. session.cookie_domain

Computer Science & Information Technology

In which step of the Systems Development Life Cycle (SDLC) are the logical and physical components defined?

a. systems recovery
b. systems analysis
c. systems design
d. systems implementation and review

Computer Science & Information Technology

What team member role, if necessary, learns about the situation and the response and then acts as official spokesperson for the organization to the public or other interested parties??

A. ?dispatcher B. ?manager C. ?technical support specialist D. ?public relations specialist

Computer Science & Information Technology

The term surfing refers to the process of searching the web for specific information.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology