D
Q. Which class constructor is called in the following C++ code?
#include<iostream> using namespace std; class A { public: A() { cout << " The constructor of class A is called." << endl; } }; class B { public: B() { cout << " The constructor of class B is called." << endl; } }; class C: public A, public B { public: C() { cout << " The constructor of class C is called." << endl; } }; int main() { C c; return 0; }
In case of multiple inheritance, the constructors of parent classes are always called in the order of inheritance from left to right and the destructors are called in reverse order.
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. Which of the following is the correct class of the object cout?
Q. What is the output of this program?
Q. Classes which is used in CPP are:
Q. Which one of the following is a keyword?
Q. Which data structure is used by Map?
Q. Class function which is called automatically as soon as the object is created is called as __
Q. Which of the following best defines the syntax for template function?
Q. Which of the following statements is not true about preprocessor directives?
Discusssion
Login to discuss.