while kotlin android code example
Example 1: kotlin while
var i = 1
while (i < 5) { // while loop
println(i)
i++
}
var i = 1
do { // do-while loop
println(i)
i++
} while (i < 5)
Example 2: kotlin while loop
while ( isTrue() );
while ( isTrue() ) {
println("while!")
}
do {
println("do while!")
} while (isTrue())