1
1
Fork 0
AtomicKotlinCourse/Introduction to Objects/Variable Argument Lists/Exercise 2/task.md

526 B

Variable Argument Lists (#2)

Write a function printArgs() with a String as the first parameter, and a vararg parameter of Int as the second parameter. printArgs() displays its arguments on the console: first the String, then the Ints, separated by commas and surrounded by square brackets.

For example, the output for printArgs("Numbers: ", 1, 2, 3) should be:

Numbers: [1, 2, 3]

Use toList() on the vararg parameter to get the requested String representation.