Why is the base class constructor called before the derived class and the derived class destructor called before based class destructor? Please I need brief explanation on this. | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Why is the base class constructor called before the derived class and the derived class destructor called before based class destructor? Please I need brief explanation on this.

6th Aug 2016, 3:10 PM
shola ola ibrahim
shola ola ibrahim - avatar
2 ответов
+ 1
it is look like very simple if you relate in real life..suppose base class like parents and derive as a child
6th Aug 2016, 7:40 PM
Sajad Hussain
Sajad Hussain - avatar
0
yep, that is pretty real life scenario, just like you come from your parents and your parents are suppose to go before u
2nd Sep 2016, 11:22 AM
FETUGA IBRAHIM