Scala中有和Java类似的while循环语句,如下:
var i = 5 while (i > 0) { i -= 1 printf("i is %d ",i) }
也有do-while语句,如下:
var i = 0 do { i += 1 println(i) }while (i<5)