Question OOP-POLY-0061
HardWhat is the output of this code?
#include <iostream>
using namespace std;
class Base {
public:
Base() { hello(); }
virtual void hello() { cout << "Base "; }
};
class Der : public Base {
public:
Der() { hello(); }
void hello() override { cout << "Der "; }
};
int main() {
Der d;
}
- A.
Der Der
- B.
Der Base
- C.
Sign up free to see the answer and a step-by-step explanation.