To avoid duplicating code, use ________, rather than ________. Group of answer choices a class that does not extend Object, a class that explicitly extends Object a class that explicitly extends Object, a class that does not extend Object inheritance, the "copy-and-past" approach. the "copy-and-paste" approach, inheritance

Respuesta :

Answer:

inheritance, the "copy-and-past" approach.

Explanation:

To avoid duplicating code, use inheritance, rather than "copy-and-past" approach.

This is because object inheritance can make Objects of a subclass to be treated like an objects of their superclass. Object inheritance enables or makes new objects to take on the properties of existing objects. When this happens the new object is a unique object but have the properties of an existing object, it eradicates the art of duplication, unlike when one is using the copy and paste approach, the program code will be duplicated in a the parts of the program where they are pasted. This will cause some sort of redundancy.

Hence, the importance of object inheritance cannot be overemphasised in making programs look better.

ACCESS MORE