Question
Option 1 : B, then C, then D / B, फिर C, फिर D
Detailed Solution
सही उत्तर B, then C, then D / B, फिर C, फिर D है।
Question:
In C++ multiple inheritance, for the declaration class D : public B, public C { ... }; D obj; the order in which constructors execute is ___ / C++ मल्टीपल इनहेरिटेंस में, घोषणा class D : public B, public C { ... }; D obj; हेतु कंस्ट्रक्टरों के निष्पादन का क्रम ___ है
Correct Answer: B, then C, then D / B, फिर C, फिर D
Base-class constructors run before the derived-class constructor, in the order the bases appear in the declaration list: B first, then C, then D. Destructors run in the reverse order. / व्युत्पन्न-क्लास कंस्ट्रक्टर से पहले बेस-क्लास कंस्ट्रक्टर चलते हैं, घोषणा सूची में बेसों के दिखने के क्रम में: पहले B, फिर C, फिर D। डिस्ट्रक्टर उल्टे क्रम में चलते हैं।