scalabasic

scala basic knowledge

val const var nonconst val functions: def fname(x: Int):Int = { var r=1 r } yield: generate a collection: for(i <-1 to 5) yield i%3 //will generate Vector(1,2,0,1,2) val nums = new ArrayInt

0 until 5: Range(0,1,2,3,4*)

_: e.g. 1 to 5 : _ will treat 1 to 5 as parameter series