157. Polymorphism-ii

Question.3

A developer prevents further overriding:

class IDriver {
public:
   virtual void init() = 0;
};
class UART : public IDriver {
public:
   void init() final { /* UART init */ }
};
class DebugUART : public UART {
public:
   void init() override { /* Override? */ }
};

Will DebugUART compile?

Need Help? Refer to the Quick Guide below

Select Answer