Inheritance Flashcards

1
Q

Giving a child class a parent

A

Put the parent class in the brackets of the child class when you define it’s attributes e.g making the class “dog”s parent class “animal”

Class Dog(animal):

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

Multi-level inheritance

A

When a derived(child) class inherits another derived(child) class

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

Multiple inheritance

A

When a child class is derived from more than just one parent class

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

Method overriding

A

When a child uses a different version of a parents method (this method is prioritised)

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

Method chaining

A

Calling multiple method sequentially, each call performs an action on the same object and returns self.

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