C++ Programming Questions Answers - Set 2

  • 8. We can do constructor overloading in C++ ?

    1. True
    2. False
    Answer :

    Option B

    Explanation:

    constructor overloading can be done in C++.

  • 9. The private data members of a class are accessible ?

    1. Directly to objects of that class
    2. To any function defined outside a class
    3. Only to the member functions
    4. Only using keyword static
    Answer :

    Option C

  • 10. Explicit call to a constructor means ?

    1. Not providing the construction name at all
    2. Is the shorthand method
    3. Providing the constructor name explicitly to invoke it
    4. Providing the constructor name implicitly to invoke it
    Answer :

    Option C

  • 11. The derived class constructor

    1. never passes any values to base class constructor
    2. can pass arguments only to one base class constructor function
    3. is responsible for passing the entire test of arguments needed by base class constructors
    4. none of above
    Answer :

    Option C

  • 12. The process of deriving a class from another derived class is known as ?

    1. single inheritance
    2. dual inheritance
    3. multiple inheritance
    4. multilevel inheritance
    Answer :

    Option D

  • 13. The advantage of declaring a virtual function as pure is
    ?

    1. programs runs faster
    2. early binding can be achieved
    3. you force any derived class to define its own implementation
    4. you can avoid making the class an abstract class
    Answer :

    Option C

  • 14. Which of following valid option will not return a value in c++ ?

    1. free
    2. void
    3. empty
    4. null
    Answer :

    Option B

Please Like Us