Map和Set中常用的一些方法。
var jetset = Set("one","two") jetset += "three" println(jetset.contains("four")) println(jetset.contains("three")) jetset.foreach(arg => println(arg)) print(jetset.size) import scala.collection.mutable.Map val treasureMap = Map[Int,String]() treasureMap +=(1->"one") treasureMap +=(2->"two") treasureMap +=(3->"three") print(treasureMap(1))
原文地址:http://blog.csdn.net/u011740475/article/details/41510921