Intermediate
Kotlin
Q62 / 100
What is the spread operator * used for with vararg?
Correct! Well done.
Incorrect.
The correct answer is B) Passing the contents of an array as individual vararg arguments
B
Correct Answer
Passing the contents of an array as individual vararg arguments
Explanation
If fun f(vararg xs: Int) and vals arr = intArrayOf(1, 2), call f(*arr) to unpack the array as individual arguments.
Progress
62/100