Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/chen18677338530/article/details/91444668
The basic syntax
Precautions
object Demo18 {
def main(args: Array[String]): Unit = {
var i:Int = 0
while (i < 10){
println("hello " + i)
i += 1
}
}
}
do ... while loop
object Demo19 {
def main(args: Array[String]): Unit = {
var i:Int = 0
do {
println("hello "+ i)
i += 1
} while (i < 10)
}
}