Mules are hybrid animals. Charles Darwin found them most surprising. Mules possess more reason, memory, obstinacy, social affection, powers of muscular endurance, endurance, and length of life than either of their parents, namely donkey and horse.
Now, the question is how would we model mules in our system? Mules obviously walk and move goods. So, we might be tempted to model mules by extending both
Donkey. Alas! We cannot! Java allows a class to extend from only one class—also known as a single inheritance. We don't wish to rewrite the
moveGoods methods again for mules. If the language allowed us to extend
mules from both
Donkey, it would be just the thing! Let's see the following diagrammatic representation ...