In multilevel inheritance constructors will be executed
from the .... class to ... class
Answers were Sorted based on User's Feedback
Answer / ps
Constructors are always executed from the parent to child
ie in the example below:
using namespace std;
cout<<"In constructor of base1"<<endl;
cout<<"In destructor of base1"<<endl;
class base2:public base1
cout<<"In constructor of base2"<<endl;
cout<<"In destructor of base2"<<endl;
class derived :public base2
cout<<"In constructor of derived"<<endl;
cout<<"In destructor of derived"<<endl;
In constructor of base1 --- for object b1
In constructor of base1 --- for object b2
In constructor of base2-----
In constructor of base1-for object d1
In constructor of base2
In constructor of derived
|Is This Answer Correct ?||19 Yes||6 No|
Answer / chaitanya
In constructor of base1-----for object b1
In constructor of base1-----for object b2
In constructor of base2------for object b2
In constructor of base1-----for object d1
In constructor of base2-----for object d1
In constructor of derived----for object d1
In destructor of derived
In destructor of base2
In destructor of base1
|Is This Answer Correct ?||12 Yes||6 No|
what is single inheritance?
i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????
What Is a Polymorphism? How many types of polymorphism and whats that use in application?
What is operator overloading? Give Example
I am developing a payroll system mini project.I used file concept in program for reading and writing.When the program is reloading into the memory that is if i execute next time the file was cleaned and adding data from the starting this is my problem.I want to strore the previous data and if i want to add any record that should be next of previous data.Please help me.
What are the different forms of polymorphism??
what is the drawback of classical methods in oops?
Advantage and disadvantage of routing in telecom sector
What is the difference between C++ and java?
How to Increment the value of the empid E001 for each and every employee by using the programe?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)