526 B
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 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]
Use toList()
on the vararg
parameter to get the requested String
representation.