while循环

val items = listOf("apple", "banana", "kiwi")
var index = 0
while (index < items.size) {
    println("item at $index is ${items[index]}")
    index++
}
do {
    val y = retrieveData()
} while (y != null) // y在这里可见

results matching ""

    No results matching ""