A class definition (subclass) that inherits from another class can define a method to override a PUBLIC or PROTECTED method in its class hierarchy as long as it is not marked FINAL. The method must have a compatible access mode and the same method name, scope, return type, and number of parameters, and each corresponding parameter must be of the same mode (INPUT, OUTPUT, or INPUT-OUTPUT) and of the same data type as the method it is overriding. A compatible access mode means that the overriding method can have a less restrictive access mode than the overridden method. For example, a PUBLIC subclass method can override a PROTECTED super class method. The same scope means the methods must both be instance methods or both be static methods. The overriding method must also use the OVERRIDE keyword to assure the compiler that the override is intended. The method that is overridden does not need to be in the immediate super class. If ABL does not find a matching method in the immediate super class in the hierarchy, it searches further up the hierarchy. If no matching method is found in the hierarchy, ABL returns a compile-time error.
Once a method has been overridden, all calls to that method invoke the method in the most derived subclass where it is overridden. This is true whether the method is called from outside (using an object reference) or from inside the class hierarchy of the object. Thus, you can call any accessible method, whether it is abstract or implemented at the point of invocation. For more information on calling methods inside and outside of a class hierarchy, see
Callingclass-based methods.