Multiple Inheritance Flashcards
1
Q
If a class implements an interface Z, which extends interfaces X and Y, and each of those defines a constant W… seeing as they are providing the same data member, how do we tell the difference between them?
A
2
Q
What are the 3 ways we can implement multiple inheritance in Java?
A
- Use interfaces: a class can implement multiple interface in Java
- Duplicate code: you can inherit from one of the two classes you need to be a child of, and duplicate the code of the other
- Use limitation: insert objects lower into a hierarchy, and override methods that you don’t want with empty bodies.
3
Q
How do you get over name ambiguity in C++ with multiple inheritance?
A
4
Q
What would happen as a result of the attached code?
A
5
Q
What would happen as a result of this code?
A
6
Q
Where are A, B and C’s entry points?
A
7
Q
A
8
Q
A
9
Q
In c++ how doe inheriting a class virtually work?
A
10
Q
A
11
Q
What does virtual inheritance in C++ require?
A
12
Q
How does virtual + friend work?
A