Method overriding is a language feature. Its part of the object-oriented programming concept.
If you have two classes, the implementation of a sub class replaces (overrides) the implementation of the super class.
Simplified, you can call it “method replacement”.
The ruby program below creates defines two classes with the same method. Class SUB inherits from the SUPER class.
Class SUB replaces the implementation of the method hello. Once a new object is created, that implementation is used.
If the method is not defined in the sub class, it will use the implementation of the super class.
Methods can be redefined. It will always use the latest method. It’s recommended that you only use one method definition.