Skip to content

Instantly share code, notes, and snippets.

@stephenLee
Created September 17, 2012 09:12
Show Gist options
  • Save stephenLee/3736361 to your computer and use it in GitHub Desktop.
Save stephenLee/3736361 to your computer and use it in GitHub Desktop.
Scala repeated parameters demo
/**
* place an asterisk after the type of the parameter
*/
def echo(args: String*) =
for (arg <- args) printn(arg)
echo("hello", "world")
val arr = Array("What's", "up", "doc?")
echo(arr: _*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment