Home » C++ Programming » Classes & Objects » Question
  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    class BaseClass
    {
    public:
    BaseClass(){}
    ~BaseClass(){}
    protected:
    private:
    };
    class DerivedClass:public BaseClass
    {
    public:
    DerivedClass(){}
    DerivedClass(){}
    private:
    protected:
    };
    int main()
    {
    cout << "The program exceuted" << endl;
    }
    1. Compilation Error
    2. The program exceuted
    3. Runtime Error
    4. Garbage value
    5. None of these
Correct Option: B

Compilation Error

error: 'DerivedClass::DerivedClass()' cannot be overloaded
error: with 'DerivedClass::DerivedClass()'



Your comments will be displayed only after manual approval.