Moderatoren: pmueller, SE - Design and Construction
- Beiträge: 19
- Registriert: 29. Okt 2017 21:47
is there some point to override used in:
Maybe I am missing something but the method to be overridden is within an abstract class an has no body whatsoever. So I couldnt figure out why a class inheriting the abstract class should override the method eat when by default you are forced to create an implementation. Thank you.
- Beiträge: 448
- Registriert: 25. Sep 2007 12:12
Here, "override" is used to get informed by the compiler if the method no longer overrides something. I.e., it is an instance of "defensive programming".