Scala Do-While循环
示例
var line = 0var maximum_lines = 5
do {
line = line + 1
println("号码: " + line)
} while (line < maximum_lines)
该do/while循环函数式编程不常使用,但可以用来解决缺乏为支撑break/continue结构,在其他语言中看到:
if(initial_condition) do if(filter) {...
} while(continuation_condition)
以上是 Scala Do-While循环 的全部内容, 来源链接: utcz.com/z/345213.html