Kotlin - Functions
Which of the following is the correct syntax to declare an infix function in Kotlin?
infix before fun, have exactly one parameter, and a body.infix fun add(x: Int): Int = this + x. fun infix add(x: Int, y: Int): Int = x + y has two parameters, invalid. infix fun add(x: Int): Int misses function body. fun add infix(x: Int): Int = this + x has wrong keyword order.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions