Question OOP-INH-0041
MediumWhat is the output of this code?
#include <iostream>
using namespace std;
class A {
public:
A() { cout << "A"; }
~A() { cout << "a"; }
};
class B : public A {
public:
B() { cout << "B"; }
~B() { cout << "b"; }
};
int main() {
B obj;
}
- A.
BAba
- B.
ABab
- C.
Sign up free to see the answer and a step-by-step explanation.