Home / CSE MCQs / C++ - MCQs :: Inheritance - C++

CSE MCQs :: C++ - MCQs

  1. What does inheriatance allows you to do?
  2. A.
    create a class
    B.
    create a hierarchy of classes
    C.
    access methods
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What is the syntax of inheritance of class?
  4. A.
    class name
    B.
    class name : access specifer
    C.
    class name : access specifer class name
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. How many types of inheritance are there in c++?
  6. A.
    2
    B.
    3
    C.
    4
    D.
    5

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What is meant by containership?
  8. A.
    class contains objects of other class types as its members
    B.
    class contains objects of other class types as its objects
    C.
    both a & b
    D.
    none of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. How many types of constructor are there in C++?
  10. A.
    1
    B.
    2
    C.
    3
    D.
    4

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. How many constructors can present in a class?
  12. A.
    1
    B.
    2
    C.
    3
    D.
    multiple

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. What should be the name of constructor?
  14. A.
    same as object
    B.
    same as member
    C.
    same as class
    D.
    none of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. What does derived class does not inherit from the base class?
  16. A.
    constructor and destructor
    B.
    friends
    C.
    operator = () members
    D.
    all of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. What is meant by polymorphism?
  18. A.
    class having many forms
    B.
    class having only single form
    C.
    class having two forms
    D.
    none of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Which design patterns benefit from the multiple inheritance?
  20. A.
    Adapter and observer pattern
    B.
    Code pattern
    C.
    Glue pattern
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum