156. Polymorphism-i

Question.2

The same code, but without the virtual keyword:

class Protocol {
public:
   void send(uint8_t d) { printf("Generic"); }  // NOT virtual
};
class UART : public Protocol {
public:
   void send(uint8_t d) { printf("UART"); }
};

Protocol* p = new UART();
p->send(0x55);

What is printed?

Need Help? Refer to the Quick Guide below

Select Answer