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

20 lines
526 B
Markdown

## 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 `Int`s, separated by
commas and surrounded by square brackets.
For example, the output for `printArgs("Numbers: ", 1, 2, 3)` should be:
```
Numbers: [1, 2, 3]
```
<div class="hint">
Use `toList()` on the `vararg` parameter to get the requested `String`
representation.
</div>