Which Among The Following Is Correct For The Following Codep #727
Which among the following is correct for the following code?</p> <pre><code class="language-cpp"> class A { public : class B { public : B(int i): data(i) { } int data; } }; class C: public A { class D:public A::B{ }; }; </code></pre>
This multiple choice question (MCQ) is related to the book/course
gs gs111 OOP Object Oriented Programming Java.
It can also be found in
gs gs111 Inheritance & its Types - OOPs MCQ: Types of Inheritance - Quiz No.1.
Which among the following is correct for the following code?
class A { public : class B { public : B(int i): data(i) { } int data; } }; class C: public A { class D:public A::B{ }; };
Multi-level inheritance is used, with nested classes
Multiple inheritance is used, with nested classes
Single level inheritance is used, with enclosing classes
Single level inheritance is used, with both enclosing and nested classes