MCQOPTIONS
Saved Bookmarks
This section includes 17 Mcqs, each offering curated multiple-choice questions to sharpen your Object Oriented Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
If base class contains 2 nested classes, will it be possible to implement single level inheritance? |
| A. | Yes, always |
| B. | Yes, only if derived class also have nested classes |
| C. | No, it will use more than 2 classes which is wrong |
| D. | No, never |
| Answer» B. Yes, only if derived class also have nested classes | |
| 2. |
Which constructor will be called first from the classes involved in single inheritance from object of derived class? |
| A. | Base class constructor |
| B. | Derived class constructor |
| C. | Both class constructors at a time |
| D. | Runtime error |
| Answer» B. Derived class constructor | |
| 3. |
Single level inheritance will be best for___________ |
| A. | Inheriting a class which performs all the calculations |
| B. | Inheriting a class which can print all the calculation results |
| C. | Inheriting a class which can perform and print all calculations |
| D. | Inheriting all the classes for different calculations |
| Answer» C. Inheriting a class which can perform and print all calculations | |
| 4. |
Which language doesn’t support single level inheritance? |
| A. | Java |
| B. | C++ |
| C. | Kotlin |
| D. | All languages support it |
| Answer» E. | |
| 5. |
Single level inheritance is safer than _____________ |
| A. | Multiple inheritance |
| B. | Interfaces |
| C. | Implementations |
| D. | Extensions |
| Answer» B. Interfaces | |
| 6. |
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 |
| Answer» C. Multilevel inheritance | |
| 7. |
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 |
| Answer» D. The derived class must implement all the abstract method if single inheritance is used | |
| 8. |
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 |
| Answer» E. | |
| 9. |
Which method in the code below is single level inherited? |
| A. | Class A |
| B. | Class B |
| C. | Class C |
| D. | NoneView Answer |
| Answer» C. Class C | |
| 10. |
Single level inheritance supports _____________ inheritance. |
| A. | Runtime |
| B. | Compile time |
| C. | Multiple inheritance |
| D. | Language independency |
| Answer» B. Compile time | |
| 11. |
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 |
| Answer» B. At most 2 classes | |
| 12. |
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 |
| Answer» B. That is multilevel inheritance | |
| 13. |
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 |
| Answer» C. One base class inherits from one derived class | |
| 14. |
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 |
| Answer» B. Multiple inheritance | |
| 15. |
Which language doesn’t support single level inheritance?$# |
| A. | Java |
| B. | C++ |
| C. | Kotlin |
| D. | All languages support it |
| Answer» C. Kotlin | |
| 16. |
Single_level_inheritance_is_safer_than______________$ |
| A. | Multiple inheritance |
| B. | Interfaces |
| C. | Implementations |
| D. | Extensions |
| Answer» E. | |
| 17. |
Garbage value |
| A. | Compile time error |
| B. | Runtime error |
| C. | Runs but gives random values as output |
| Answer» C. Runs but gives random values as output | |