Unlike Java function arguments, Kotlin supports default arguments in functions. This enables flexible function writing, as in the following code:
fun withDefaultValues(name : String = "Shazin", age : Int = 32) {
println("Name $name and Age $age");
}
The preceding function can be called as follows:
withDefaultValues();
withDefaultValues("Shahim", 32);