Scala While loop
object WhileLoop {
def main(args:Array[String]) {
var cnt = 1
while (cnt < 10) {
cnt += 1
println(cnt)
}
println("done")
}
}
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
object WhileLoop {
def main(args:Array[String]) {
var cnt = 1
while (cnt < 10) {
cnt += 1
println(cnt)
}
println("done")
}
}