January 2018
Intermediate to advanced
414 pages
10h 29m
English
Kotlin allows us to specify default parameters when declaring functions:
fun compute(number1: Int, number2: Int = 2, number3: Int = 5) = number1 * number2 * number3
This could be used as:
println(compute(7))println(compute(7, 2))println(compute(7, 2, 8))println(compute(number1 = 8, number3 = 4))
Read now
Unlock full access