我刚刚开始学习 Scala。在浏览 Scaladocs 时,我在以下位置看到了这个方法定义mutable.Map
:
def -=(elem1: A, elem2: A, elems: A*): Map.this.type
Removes two or more elements from this shrinkable collection.
elem1 the first element to remove.
elem2 the second element to remove.
elems the remaining elements to remove.
returns the shrinkable collection itself
如果您只是要定义a elem1
,为什么还需要明确定义?elem2
elems
*