Which of the following constructor related concept is non-relevant in C++ ?
कन्स्ट्रक्टर संबंधी सिद्धान्तों में निम्न में से कौन-सा C++ में अप्रासंगिक है ?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. virtual constructorवर्चुअल कन्स्ट्रक्टर
Explanation
C++ has copy, conversion and overloaded constructors, but a constructor can never be virtual (the object's type is not yet known while it is being built). Only destructors can be virtual.
C++ में कॉपी, कन्वर्जन और ओवरलोडेड कन्स्ट्रक्टर होते हैं, पर कन्स्ट्रक्टर कभी virtual नहीं हो सकता। केवल डिस्ट्रक्टर virtual हो सकता है।
More Programming Concepts & Python questions
- In C++, which of the following is not a derived container under STL ?
- In C++, an overloaded unary operator defined as a member function requires how many variables to be passed as function argument ?
- How many times 'save trees' will be displayed by C++ loop ? do { cout << "save trees"; } while(0);
- Consider Column-I and Column-II in context of C++ : Column-I Column-II i. Private a. Data type modifier ii. Sizeof b. Visibility specifier…
- Choose true statements about virtual functions in C++ : I : The virtual functions must be member of some class. II : They cannot be static…
- In context of C++, which of the following is a valid statement ?