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.

11. Members which are not intended to be inherited are declared as:
a. Public members
b. Protected members
c. Private members
d. Private or Protected members
View Answer Report Discuss Too Difficult!
Answer: (c).Private members

12. While inheriting a class, if no access mode is specified, then which among the following is true? (in C++)
a. It gets inherited publicly by default
b. It gets inherited protected by default
c. It gets inherited privately by default
d. It is not possible
View Answer Report Discuss Too Difficult!
Answer: (c).It gets inherited privately by default

13. If a derived class object is created, which constructor is called first?
a. Base class constructor
b. Derived class constructor
c. Depends on how we call the object
d. Not possible
View Answer Report Discuss Too Difficult!
Answer: (a).Base class constructor

14. The private members of the base class are visible in derived class but are not accessible directly.
a. True
b. False
c. May be
d. Can't say
View Answer Report Discuss Too Difficult!
Answer: (a).True

15. How can you make the private members inheritable?
a. By making their visibility mode as public only
b. By making their visibility mode as protected only
c. By making their visibility mode as private in derived class
d. It can be done both by making the visibility mode public or protected
View Answer Report Discuss Too Difficult!
Answer: (d).It can be done both by making the visibility mode public or protected

16. How many types of inheritance are possible in C++?
a. 2
b. 3
c. 4
d. 5
View Answer Report Discuss Too Difficult!
Answer: (d).5

17. Which among the following is true?
a. Java supports all types of inheritance
b. Java supports multiple inheritance
c. Java doesn’t support multiple inheritance
d. Java doesn’t support inheritance
View Answer Report Discuss Too Difficult!
Answer: (c).Java doesn’t support multiple inheritance

18. Which type of inheritance is illustrated by the following code?
class student{ public: int marks; };
class topper: public student { public: char grade; };
class average{ public: int makrs_needed; };
class section: public average{ public: char name[10];  };
class overall: public average{  public: int students;  };
a. Single level
b. Multilevel and single level
c. Hierarchical
d. Hierarchical and single level
View Answer Report Discuss Too Difficult!
Answer: (c).Hierarchical

19. Which among the following best describes multiple inheritance?
a. Two classes being parent of any other classes
b. Three classes being parent of other classes
c. More than one class being parent of other child classes
d. More than one class being parent of single child
View Answer Report Discuss Too Difficult!
Answer: (d).More than one class being parent of single child

20. How many types of inheritance can be used at a time in single program?
a. Any two types
b. Any three types
c. Any 4 types
d. Any type, any number of times
View Answer Report Discuss Too Difficult!
Answer: (d).Any type, any number of times

Page 2 of 11