Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个功能:
def test(ints: Int*) = ints.foreach(println(_))
如何将 Array[Int] 或 Seq[Int] 转换为 Int*?
这就是_*类型归属的用途:
_*
def test(ints: Int*) { ints foreach println } val l = List(1, 2, 3) test(l:_*) // 1 // 2 // 3