January 2018
Intermediate to advanced
434 pages
14h 1m
English
If you come from the Java world, you might remember that we can't specify a default value to methods. This means that we can't do something like this in Java:
public void foo(int a, int b=10){}
We need to write two methods for it, and it is known as method overloading:
public void foo(int a){}public void foo(int a, int b){}
Also, suppose you have a function with three different kinds of parameters, such as these:
public void foo (int a,double b, String c){}
Then you'll have seven instances of method overloading:
public void foo (int a,double b, String c),public void foo (int a,double b) ,public void foo (double b, String c),public void foo (int a, String c),public void foo (int a),public void foo (double ...
Read now
Unlock full access