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

1. If class D is derived from class B then class D has only some of the members from B, and the additional members defined in D.

2. A programmer can use inheritance with an existing library for which only the header file and binary are available, to derive a class more suitable to her purpose.


1. False
Explanation: If class D is derived from class B, D automatically receives all of the members of B, and the members defined in D. (The private members of B are also inherited, though it is important to note that those are inaccessible to functions defined in D.)
2. True
Explanation: This feature of inheritance allows code reuse. The programmer needs only the class definition, not the implementation of the member functions of the class.

Computer Science & Information Technology

You might also like to view...

Discuss the ways in which inheritance saves time during program development and helps prevent errors.

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

Computer Science & Information Technology

Relationship options that enable you to update records in related tables when referential integrity is enforced are known as:

a. cascade options b. parameters c. table relationships

Computer Science & Information Technology

Using an alias is a violation of Facebook policies, and users can have their accounts suspended if someone reports it

Indicate whether the statement is true or false

Computer Science & Information Technology

If you select an object and then choose a harmony rule in the Color Guide, the selected object will change to the base color of the harmony rule.

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

Computer Science & Information Technology