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

CSE MCQs :: C++ - MCQs

  1. Which is used to create a pure virtual function ?
  2. A.
    $
    B.
    =0
    C.
    &
    D.
    !

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which is also called as abstract class?
  4. A.
    virtual function
    B.
    pure virtual function
    C.
    derived class
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. What is meant by pure virtual function?
  6. A.
    Function which does not have definition of its own.
    B.
    Function which does have definition of its own.
    C.
    Function which does not have any return type.
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Pick out the correct option.
  8. A.
    We cannot make an instance of an abstract base class
    B.
    We can make an instance of an abstract base class
    C.
    Both a & b
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Where does the abstract class is used?
  10. A.
    base class only
    B.
    derived class
    C.
    both a & b
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Where is the derived class is derived from?
  12. A.
    derived
    B.
    base
    C.
    both a & b
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Pick out the correct statement.
  14. A.
    A derived class's constructor cannot explicitly invokes its base class's constructor.
    B.
    A derived class's destructor cannot invoke its base class's destructor.
    C.
    A derived class's destructor can invoke its base class's destructor.
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Which of the following can derived class inherit?
  16. A.
    members
    B.
    functions
    C.
    both a & b
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Which operator is used to declare the destructor?
  18. A.
    #
    B.
    ~
    C.
    @
    D.
    $

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Which constructor will initialize the base class data member?
  20. A.
    derived class
    B.
    base class
    C.
    class
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum