5.7k views
3 votes
Which of the following is an example of multiple inheritance?

a. Macintosh and IBM PC are both types of PCs
b. a computer can be a mainframe or a PC
c. a PC can be a desktop or a laptop
d. a laptop is both a PC and a portable device
e. a portable device is a lightweight device

User Pholz
by
4.6k points

1 Answer

3 votes

Answer:

D) A laptop is both a PC and a portable device

Step-by-step explanation:

In Object oriented programming multiple inheritance refers to a class or the object of a class inheriting multiple characteristics from more than one parent class. Bringing this idea to the scenario in this question, we see that a laptop shares several common characteristics and features of a PC as well as portable devices so this can be seen as an example of multiple inheritance.

User Unjuken
by
5.5k points