Function Type With Nullable

Run Settings
LanguageKotlin
Language Version
Run Command
fun main(args : Array<String>){ val sumResult = sum?.invoke(10, 10) println(sumResult) //tanpa invoke val multiplyResult = multiply(20, 20) println(multiplyResult) } //null able typealias Arithmetic = (Int, Int) -> Int ? val sum: Arithmetic = { valueA, valueB -> valueA + valueB } val multiply: Arithmetic = { valueA, valueB -> valueA * valueB }
Editor Settings
Theme
Key bindings
Full width
Lines