PrepAway - Latest Free Exam Questions & Answers

In object-oriented programming, when all the methods of one class are passed on to a subclass, this is called:

In object-oriented programming, when all the methods of one class are passed on to a subclass, this
is called:

PrepAway - Latest Free Exam Questions & Answers

A.
Delegation

B.
Inheritance

C.
Multiple Inheritance

D.
Forward chaining

Explanation:
In inheritance, all the methods of one class, called a superclass, are inherited by a subclass. Thus, all
messages understood by the superclass are understood by the subclass. In other words, the subclass
inherits the behavior of the superclass. *Answer Forward chaining is a distracter and describes datadriven reasoning used in expert systems. *Multiple inheritancedescribes the situation where a
subclass inherits the behavior of multiple superclasses. *Answer delegation, is an alternative to
inheritance in an object-oriented system. With delegation, if an object does not have a method to
satisfy a request it has received, it can delegate the request to another object.


Leave a Reply