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.

1. Which among the following best describes the Inheritance?
a. Copying the code already written
b. Using the code already written once
c. Using already defined functions in programming language
d. Using the data and functions into derived segment
View Answer Report Discuss Too Difficult!
Answer: (d).Using the data and functions into derived segment

2. How many basic types of inheritance are provided as OOP feature?
a. 4
b. 3
c. 2
d. 1
View Answer Report Discuss Too Difficult!
Answer: (a).4

3. Which among the following best defines single level inheritance?
a. A class inheriting a derived class
b. A class inheriting a base class
c. A class inheriting a nested class
d. A class which gets inherited by 2 classes
View Answer Report Discuss Too Difficult!
Answer: (b).A class inheriting a base class

4. Which among the following is correct for multiple inheritance?
a. class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ };
b. class student{int marks;}; class stream{ }; class topper: public student{ };
c. class student{int marks;}; class stream:public student{ };
d. class student{ }; class stream{ }; class topper{ };
View Answer Report Discuss Too Difficult!
Answer: (a).class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ };

5. Which programming language doesn’t support multiple inheritance?
a. C++ and Java
b. C and C++
c. Java and SmallTalk
d. Java
View Answer Report Discuss Too Difficult!
Answer: (d).Java

6. Which among the following is correct for hierarchical inheritance?
a. Two base classes can be used to be derived into one single class
b. Two or more classes can be derived into one class
c. One base class can be derived into other two derived classes or more
d. One base class can be derived into only 2 classes
View Answer Report Discuss Too Difficult!
Answer: (c).One base class can be derived into other two derived classes or more

7. Which is the correct syntax of inheritance?
a. class derived_classname : base_classname{ /*define class body*/ };
b. class base_classname : derived_classname{ /*define class body*/ };
c. class derived_classname : access base_classname{ /*define class body*/ };
d. class base_classname :access derived_classname{ /*define class body*/ };
View Answer Report Discuss Too Difficult!
Answer: (c).class derived_classname : access base_classname{ /*define class body*/ };

8. Which type of inheritance leads to diamond problem?
a. Single level
b. Multi-level
c. Multiple
d. Hierarchical
View Answer Report Discuss Too Difficult!
Answer: (c).Multiple

9. Which access type data gets derived as private member in derived class:
a. Private
b. Public
c. Protected
d. Protected and Private
View Answer Report Discuss Too Difficult!
Answer: (a).Private

10. If a base class is inherited in protected access mode then which among the following is true?
a. Public and Protected members of base class becomes protected members of derived class
b. Only protected members become protected members of derived class
c. Private, Protected and Public all members of base, become private of derived class
d. Only private members of base, become private of derived class
View Answer Report Discuss Too Difficult!
Answer: (a).Public and Protected members of base class becomes protected members of derived class

Page 1 of 11