我剛開始學習Scala。在瀏覽過Scaladocs我看到mutable.Map
這個方法定義:在Scala中聲明一個,兩個,很多參數
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
爲什麼你需要定義elem1
和elem2
明確,如果你只是去定義elems
與*
呢?
您提供的鏈接引用'mutable.Map',而不是'Set'。由於代碼也提到了「地圖」,我冒昧地更新鏈接的文字。 – 2013-03-07 17:25:02