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 method in the code below is single level inherited?
class A
{
 protected int a, b;
 public: void show()
 { 
  cout<<a<<b;
 }
};
class B: public A
{
 public: void disp()
 { 
  cout<<a++<<b++; 
 }
};
class C: private A, public B
{
 void avg()
 { 
  cout<<(a+b)/2; 
 }
};
a. Class A
b. Class B
c. Class C
d. None
Answer:Class B
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here