原创文章,转载请注明出处!

原文地址: http://www.ptbird.cn/2016/07/19/scala-chuji-demo-01/

There I am,in the world more exciting!

by postbird

www.ptbird.cn


01 Tuple,Array,Map和文件操作


 
package com.ptbird.scala.helloworld object tuple { def main(args:Array[String]):Unit={ //tuple val tuple=(100,"Scala","spark") // println(tuple._1) // println(tuple._2) // println(tuple._3) // //Array val arr=Array(1,2,3,4) for(i <- 0 until arr.length){ // println(arr(i)); } //Map val ages=Map('a'->27,'b'->25) for((i,j) <- ages){ println(i+"--"+ages(i)) } } }