数组和集合 / 迭代器

val list = listOf(123)
val iterator = list.iterator()

while (iterator.hasNext()) {
    println(iterator.next())
}