标签:scala
笔记内容比较杂!
var hw =new helloworld("Hi,my name is lming_08")
var hw:helloworld =new helloworld("Hi,my name is lming_08")
scala> def max(x: Int, y: Int): Int = if (x < y) y else x max: (Int,Int)Int
def arrLoop(arr:Array[String])={ arr(0)="abc" arr(1)="123" arr(2)="ABC" for(elem<- arr) println(elem+", hello") } def arrLoop2(arr:Array[String])={ arr(0)="+abc" arr(1)="+123" arr(2)="+ABC" arr.foreach(elem => println(elem)) } def arrLoop3(arr:Array[String])={ arr(0)="-abc" arr(1)="-123" arr(2)="-ABC" for(i <- 0 to arr.length -1){ println(arr(i)) } }
未完待续。。。
参考资料:http://www.artima.com/scalazine/articles/steps.html
标签:scala
原文地址:http://blog.csdn.net/lming_08/article/details/38648067