Per itterator loop in kotlin

Esempi di codice

6
0

per il ciclo di kotlin

val array = arrayOf(1, 3, 9)
for (item in array) {
    //loops items
}
for (index in 0..array.size - 1) {
	//loops all indices
}
for (index in 0 untill array.size) {
    //loops all indices
}
for (index in array.indices) {
    //loops all indices (performs just as well as two examples above)
}

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................