A

Admin • 828.03K Points
Coach

Q. How do you define a function that accepts a lambda in Kotlin?

  • (A) fun test(lambda: function)
  • (B) fun test(lambda: () -> Unit)
  • (C) fun test(lambda: () => Void)
  • (D) fun test(lambda: lambda)
  • Correct Answer - Option(B)
  • Views: 3
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin
The correct syntax for a lambda parameter is '() -> Unit'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.