10/03/2008

Overload

Rules of overload
A type, the number, the order of each argument can be changed.
The access level can be less strict, not stricter.
Access keywords can be changed.
New exceptions can be added.

examples)
void myfunc() {}
void myfunc(int a){}
void myfunc(int a, int b) {}
void myfunc(double a, double b) {}
String myfunc(double a, int b) {return null;}
private void myfunc(File file) throws FileNotFoundException {}