August 2016
Beginner to intermediate
847 pages
17h 28m
English
Some programming languages allow you to define a method with the same name multiple times by passing different arguments. This feature is known as method overloading. In some cases, we can overload a constructor. However, it is very important to mention that a similar effect can be achieved with optional parameters or default values for specific arguments.
For example, we can take advantage of method overloading in a programming language that supports it to define multiple instances of the bark method. However, it is very important to avoid code duplication when we overload methods.
Sometimes, we define a method in a class and know that a subclass may need to provide a different instance of this method. ...
Read now
Unlock full access