The following code produces a compilation error. Why ?
class Parent { virtual void method() const; }; class Children: public Parent { void method() override; };
The method in Children should be declared as final.
final
C++ does not allow to override a const method.
const
The method in Children is not declared as virtual.
The method in Children does not override any method from the parent class.