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.

31. Which among the following defines single level inheritance?
a. One base class derives another class
b. One derived class inherits from one base class
c. One base class inherits from one derived class
d. One derived class derives from another derived class
View Answer Report Discuss Too Difficult!
Answer: (b).One derived class inherits from one base class

32. If class A and class B are derived from class C and class D, then ________________
a. Those are 2 pairs of single inheritance
b. That is multilevel inheritance
c. Those is enclosing class
d. Those are all independent classes
View Answer Report Discuss Too Difficult!
Answer: (a).Those are 2 pairs of single inheritance

33. If single inheritance is used, program will contain ________________
a. At least 2 classes
b. At most 2 classes
c. Exactly 2 classes
d. At most 4 classes
View Answer Report Discuss Too Difficult!
Answer: (a).At least 2 classes

34. Single level inheritance supports _____________ inheritance.
a. Runtime
b. Compile time
c. Multiple inheritance
d. Language independency
View Answer Report Discuss Too Difficult!
Answer: (a).Runtime

35. 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
View Answer Report Discuss Too Difficult!
Answer: (b).Class B

36. If single level inheritance is used and an abstract class is created with some undefined functions, can its derived class also skip some definitions?
a. Yes, always possible
b. Yes, possible if only one undefined function
c. No, at least 2 undefined functions must be there
d. No, the derived class must implement those methods
View Answer Report Discuss Too Difficult!
Answer: (d).No, the derived class must implement those methods

37. Which among the following is false for single level inheritance?
a. There can be more than 2 classes in program to implement single inheritance
b. There can be exactly 2 classes to implement single inheritance in a program
c. There can be more than 2 independent classes involved in single inheritance
d. The derived class must implement all the abstract method if single inheritance is used
View Answer Report Discuss Too Difficult!
Answer: (c).There can be more than 2 independent classes involved in single inheritance

38. Which concept will result in derived class with more features (consider maximum 3 classes)?
a. Single inheritance
b. Multiple inheritance
c. Multilevel inheritance
d. Hierarchical inheritance
View Answer Report Discuss Too Difficult!
Answer: (b).Multiple inheritance

39. Single level inheritance is safer than _____________
a. Multiple inheritance
b. Interfaces
c. Implementations
d. Extensions
View Answer Report Discuss Too Difficult!
Answer: (a).Multiple inheritance

40. Which language doesn’t support single level inheritance?
a. Java
b. C++
c. Kotlin
d. All languages support it
View Answer Report Discuss Too Difficult!
Answer: (d).All languages support it

Page 4 of 11