Learning Kotlin: Default values

Note

Previously, we covered Named Arguments, and this is a small continuation of it. We start with a simple function:

fun foo(name: String): String = todoTask3()

and we need to make it call a single Java function while providing default values—resulting in:

fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false): String = JavaCode3().foo(name, number, toUpperCase)