「Kotlin入門」do…while文を使うサンプル
書式
do {
some code
}while(条件式)
使用例
fun main() { var m = 10 do{ println("do while m value is: " + m) m = m+2 }while(m < 20) }
実行結果
>kotlinc arkgame.kt -include-runtime -d arkgame.jar
>kotlin arkgame.jar
do while m value is: 10
do while m value is: 12
do while m value is: 14
do while m value is: 16
do while m value is: 18