A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. 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{ };
};
a. Multi-level inheritance is used, with nested classes
b. Multiple inheritance is used, with nested classes
c. Single level inheritance is used, with enclosing classes
d. Single level inheritance is used, with both enclosing and nested classes
Answer:Single level inheritance is used, with both enclosing and nested classes
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here