Methods with optional parameter values in Java
Forums:
//in Java there is no default parameters values
static void SayGoodby(String message) {
System.out.println(message);
}
static void SayGoodby() {
SayGoodby("Goodby!");
}
SayGoodby();
//printed "Goodby!"
SayGoodby("see you");
//printed "see you"
- Log in to post comments