In this code:
class Base {
public:
virtual void method() = 0;
};
class Derived1 : public Base{
public:
virtual void method() override { }
};
class Derived2 : public Base{
public:
void method() override { }
};
Is there any difference between Derived1
and Derived2
?
Derived2::method2
is virtual. – Baderived2->method()
will also be virtual (implicit though) – Carlton