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

1. An object of a derived class type has exactly one type, the type with which it was declared.

2. If a base class constructor is not called explicitly in the definition of a derived class constructor, an error results.

1. False
Explanation: Object of class type whose class is derived has the “is-a” relationship to classes up the inheritance chain. A derived class has all the variables and member functions of the base class, hence is an object of base class type. It also has the member variables and functions added by its class so it is also an object of the derive class type. As the text says, an HourlyEmployee is also an Employee. Objects of class type whose class type is derived through several derivations have several types.
2. False
Explanation: If a base class constructor is not called explicitly, the default base class constructor is called. We prefer to call base class constructors explicitly.

Computer Science & Information Technology

You might also like to view...

A system with ____ divides programs into parts and keep them in secondary storage, bringing each part into memory only as it is needed.

A. virtual memory B. shared memory C. segmented processing D. passive multiprogramming

Computer Science & Information Technology

What are the requirements for sucessful installation and use of WDS?

What will be an ideal response?

Computer Science & Information Technology