scala 中map

// 1,2,3,4,5
   /* val arr = Array(1, 2, 3, 4, 5)
    for (ele <- arr){
      println(ele)
    }*/

  /*  val m1 = Map("name" -> "zhangsan", "age" -> 20)
    for ((k,v) <- m1){
      println("key is:" + k +"...." +"value is:" + v)
    }
    for ((k,_) <- m1){
      println("key is two:" + k)
    }*/
    val fs = Source.fromFile("C://t2.txt")
    println(fs +":fs")
    for (lines <- fs.getLines){
      println(lines)
    }


你可能感兴趣的:(scala 中map)