OOP fundamentals
Answer the following concept questions and provide a small example where requested:
-
Inheritance vs. polymorphism
-
Explain what
inheritance
is and what
polymorphism
is.
-
Give an example showing a child class
overriding
a parent class method.
-
Constructor vs. destructor
-
Explain the purpose of constructors and destructors and when they are executed.
-
Follow-up:
Does Python have a destructor?
If so, what is it, and what caveats exist?