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

What does the following expression evaluate to, given that a = 3 and b = 6? (a != b) AND (b > a)

a. True b. False c. NOT d. cannot tell

Computer Science & Information Technology

The keywords True and False are floating point values.

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

Computer Science & Information Technology