Question:Consider the sample code given below and answer the question that follows.
class Shape { public: virtual void draw() = 0; }; class Rectangle: public Shape { public: void draw() { // Code to draw rectangle } //Some more member functions..... }; class Circle : public Shape { public: void draw() { // Code to draw circle } //Some more member functions..... }; int main() { Shape objShape; objShape.draw(); }What happens if the above program is compiled and executed?
A Compile error
B Exception error
C 0
D None
+ AnswerD
+ Report