Loading practice questions
Which of the following is a correct example of a lambda expression in Kotlin?
Correct Answer: D — { x, y -> x + y }
Explanation:
Lambda expressions in Kotlin are defined using curly braces {}. The syntax includes parameters, followed by ->, and then the body of the lambda, e.g., { x, y -> x + y }.