Class A { A() { cout<<"a";} } ; | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Class A { A() { cout<<"a";} } ;

Now suppose class B is a derived class of A with its own constructor. Then which constructor will be executed 1st? Constructor of class A or constructor of class B? Why?

4th Jul 2017, 5:25 AM
Kushagra Agarwal
Kushagra Agarwal - avatar
1 Respuesta
+ 5
..... make the b class and put a cout in its constructor also.. :)
4th Jul 2017, 6:01 AM
jay
jay - avatar