public void myFunction(String name) { // whatever } public void myFunction(String name, boolean isAdult) { // whatever, but now this is called whenever the extra parameter // is callled instead of the other one }