Intermediate Kotlin
Q61 / 100

What is vararg in Kotlin?

Correct! Well done.

Incorrect.

The correct answer is B) A function parameter that accepts a variable number of arguments of the same type

B

Correct Answer

A function parameter that accepts a variable number of arguments of the same type

Explanation

fun sum(vararg numbers: Int) allows calling sum(1, 2, 3). Inside the function, numbers is an IntArray.

Progress
61/100