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.

61. Multiple inheritance is ____________________
a. When a class is derived from another class
b. When a class is derived from two or more classes
c. When a class is derived from other two derived classes
d. When a class is derived from exactly one class
View Answer Report Discuss Too Difficult!
Answer: (b).When a class is derived from two or more classes

62. Which problem arises due to multiple inheritance, if hierarchical inheritance is used previously for its base classes?
a. Diamond
b. Circle
c. Triangle
d. Loop
View Answer Report Discuss Too Difficult!
Answer: (a).Diamond

63. How many classes should a program contain to implement the multiple inheritance?
a. Only 1
b. At least 1
c. At least 3
d. Exactly 3
View Answer Report Discuss Too Difficult!
Answer: (c).At least 3

64. Which programming language restricts the use of multiple inheritance?
a. C++
b. PHP
c. SmallTalk
d. Java
View Answer Report Discuss Too Difficult!
Answer: (d).Java

65. Is it possible to have all the abstract classes as base classes of a derived class from those?
a. Yes, always
b. Yes, only if derived class implements all the methods
c. No, because abstract classes doesn’t have constructors
d. No, never
View Answer Report Discuss Too Difficult!
Answer: (b).Yes, only if derived class implements all the methods

66. If class A inherits class B and class C as “class A: public class B, public class C {// class body ;}; ”, which class constructor will be called first?
a. Class A
b. Class B
c. Class C
d. All together
View Answer Report Discuss Too Difficult!
Answer: (b).Class B

67. Why does diamond problem arise due to multiple inheritance?
a. Methods with same name creates ambiguity and conflict
b. Methods inherited from the superclass may conflict
c. Derived class gets overloaded with more than two class methods
d. Derived class can’t distinguish the owner class of any derived method
View Answer Report Discuss Too Difficult!
Answer: (a).Methods with same name creates ambiguity and conflict

68. How many base classes can a derived class have which is implementing multiple inheritance?
a. Only 2
b. At least 2
c. At most 2
d. As many as required
View Answer Report Discuss Too Difficult!
Answer: (d).As many as required

69. How to overcome diamond problem ?
a. Using alias name
b. Using seperate derived class
c. Using virtual keyword with same name function
d. Can’t be done
View Answer Report Discuss Too Difficult!
Answer: (c).Using virtual keyword with same name function

70. When multiple inheritance is used, which class object should be used in order to access all the available members of parent and derived class ?
a. Derived class object
b. Parent class objects
c. Use Abstract derived class
d. Derive a class from derived class
View Answer Report Discuss Too Difficult!
Answer: (a).Derived class object