Distinguish between inheriting interface and inheriting implementation. How do inheri- tance hierarchies designed for inheriting interface differ from those designed for inheriting imple- mentation?

What will be an ideal response?


When a class inherits implementation, it inherits previously defined functionality from another class. When a class inherits interface, it inherits the definition of what the interface to the new class type should be. The implementation is then provided by the programmer defining the new class type. Inheritance hierarchies designed for inheriting implementation are used to reduce the amount of new code that is being written. Such hierarchies are used to facilitate software reusability. Inheritance hierarchies designed for inheriting interface are used to write programs that perform generic processing of many class types. Such hierarchies are commonly used to facilitate software extensibility (i.e., new types can be added to the hierarchy without changing the generic processing capabilities of the program.)

Computer Science & Information Technology

You might also like to view...

Which of the following statements is correct?

) float num1; num2; b) int day, night; c) int blue = 5.0; d) string black = ‘white’;

Computer Science & Information Technology

How many possible colors can a 12-bit image have?

a. 16,777,216 b. 512 c. 1,024 d. 4,096

Computer Science & Information Technology

In general, a static variable is used in any situation in which all instances share a common data value.

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

Computer Science & Information Technology

What is the industry standard for rack height in rack units??

A. ?18U B. ?22U C. ?42U D. ?54U

Computer Science & Information Technology