Discuss the ways in which inheritance promotes software reuse, saves time during program development and helps prevent errors.
What will be an ideal response?
Inheritance allows developers to create derived classes that reuse code declared already in a base class. Avoiding the duplication of common functionality between several classes by building an inheritance hierarchy to contain the classes can save developers a considerable amount of time. Placing common functionality in a single base class, rather than duplicating the code in multiple unrelated classes, helps prevent the same errors from appearing in multiple source-code files and makes debugging easier. If several classes each contain duplicate code containing an error, the software developer has to spend time correcting each source-code file with the error. However, if these classes take advantage of inheritance, and the error occurs in the common functionality of the base class, the software developer needs to modify only the base class’s code.
You might also like to view...
Which financial function calculates the number of payment periods for an investment or loan given fixed interest rate, periodic payment, and present value?
A) IPMT B) PV C) RATE D) NPER
________ centers are central repositories for collecting intelligence at the state and local levels with the goal of preventing terrorist attacks
Fill in the blank(s) with the appropriate word(s).
Uses of RFID include tracking times of runners in a marathon and checking out library books.
Answer the following statement true (T) or false (F)
Using a sample of 40 adults, a regression equation for estimating the weight of a person in pounds () based on his or her height in inches (x) was derived. Use the equation
to estimate the weight of a person 61 in. tall.
A.
B.
C.
D.
E.