Quiz
Let's test your understanding of the polymorphism.
We'll cover the following...
We'll cover the following...
Technical Quiz
1.
What is the output of the following piece of code?
#include <iostream>
using namespace std;
class Base{
public:
virtual void print() {
cout <<" Base Print";
}
};
class Derived: public Base{
public:
void print() {
cout <<"Derived Print" ;
}
};
int main(){
Base * bp;
Derived obj;
bp = &obj;
bp->print();
}
A.
Derived Print
Base Print
B.
Base Print
C.
Derived Print
D.
None of the above
1 / 3