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