adding :_*
tells the compiler to treat the array as varargs. It works the same with Scala as with Java. If I have a method
def foo(args: Int*) = args.map{_ + 1}
I can call it as such:
foo(1, 2, 3, 4) //returns ArrayBuffer(2, 3, 4, 5)
but if I want to pass an actual sequence to it (as you are with getMethod
) I would do:
val mylist = List(1, 2, 3, 4)
foo(mylist:_*)