Loading practice questions
How do you define a single-line function in Kotlin?
Correct Answer: B — Use an equals sign = followed by the expression
Explanation:
In Kotlin, single-line functions can be defined concisely using an equals sign = followed by the expression, e.g., fun add(a: Int, b: Int) = a + b.