Not a cuestión, but an aclaration about the first question about inheritance. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
- 1

Not a cuestión, but an aclaration about the first question about inheritance.

The inheritance's first question asks if classes Mother and Daughter are base/derived classes or if they are both base classes. The correct answer seems to be that the base class is Mother and the derived one Daughter, but that is not true. Mother class might have a function goToWork(), which the daughter class doesn't need. So for me the correct answer is that they are both base classes or they are both derived classes, derived from class Person.

21st Jun 2016, 8:47 PM
Garme Kain
Garme Kain - avatar
1 Réponse
+ 3
You're right. But, it seems, that Sololearn shows example of genetic inheritance. In this case, it's not necessary to inherit all the functions. It may be partial inheritance of some attributes(sex, color of hair, etc.) and some functions(go, speak, etc.). Summary: Inheritance row is like this: "abstract Person -> ....-> Mother -> Daughter"
22nd Jun 2016, 4:20 AM
Dmitry Pudov
Dmitry Pudov - avatar