Q68: What does the `override` keyword enforce in derived class methods?

Difficulty:EasyTopic:OOP

The override keyword explicitly indicates that a method in a subclass overrides an existing method in its parent class. If the parent class method is renamed or removed, the compiler raises an error.

Key Takeaways
  • Prevents silent inheritance breakage when refactoring parent class methods.