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):
2
Q
Multi-level inheritance
A
When a derived(child) class inherits another derived(child) class
3
Q
Multiple inheritance
A
When a child class is derived from more than just one parent class
4
Q
Method overriding
A
When a child uses a different version of a parents method (this method is prioritised)
5
Q
Method chaining
A
Calling multiple method sequentially, each call performs an action on the same object and returns self.