Overloading, overriding, and hiding
We have already mentioned overriding in the Inheritance and Abstraction/interface sections. It is a replacement of a non-static method implemented in a parent class with the method of the same signatures in the child
class. The default method of an interface also can be overridden in the interface that extends it. Hiding is similar to overriding but applies only to static methods and static, as well as properties of the instance.
Overloading is creating several methods with the same name and different parameters (thus, different signatures) in the same class or interface.
In this section, we will discuss all these concepts and demonstrate how they work for classes and interfaces.
Overloading
It is not possible to have two methods in the same interface or a class with the same signature. To have a different signature, the new method has to have either a new name or a different list of parameter types (and the sequence of the type does...