‘Override’ replaces a ‘Virtual’ method by a new method.
Class X has a virtual method doSomething().
Class Y inherits/extends class X.
Class Y would like to change the method doSomething(),
so it overrides it. When calling Y.doSomething(),
the overriden/replaced method is executed.
Without the keyword ‘Override’ you could replace a
method by accident, just by using the same method
fingerprint (method name + parameters).
To avoid such accidents, you have to explicitely
use ‘Override’ to make sure it is really what you want
Ugh, docs don’t even mention methods – will fix NOW!
But as Danilo says, it’s basically indicates you’re ‘changing’ the behaviour of a method in a super class (which is usually declared ‘Virtual’, indicating it can be overridden).
This is actually the default behavior in blitzmax/monkey, where all methods are virtual/override by default. In monkey2 you must explictly declare which methods can be overriden by subclass methods (with ‘Virtual’), and which methods are overriding superclass methods (with ‘Override’).
I started to work on the docs to add some missing think. There’s a keyword index where you would have had a brief answer to the question. It is in total WIP but contains all the official infos + some I added.