Under the hood, String*
is passed as Seq[String]
. This is just syntactic sugar:
def blah(ss: String*) = {...} blah("Hi","there")
turns into
def blah(ss: Seq[String]) = {...} blah(Seq("Hi", "there"))
and :_*
just means "keep sugar, I already got what you need - Seq!"
source share