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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 3 ways we can implement multiple inheritance in Java?

A
  1. Use interfaces: a class can implement multiple interface in Java
  2. 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
  3. Use limitation: insert objects lower into a hierarchy, and override methods that you don’t want with empty bodies.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you get over name ambiguity in C++ with multiple inheritance?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What would happen as a result of the attached code?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What would happen as a result of this code?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where are A, B and C’s entry points?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In c++ how doe inheriting a class virtually work?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does virtual inheritance in C++ require?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does virtual + friend work?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly