Lists
Learn how Kotlin lists store multiple values and how to work with list items.
Kotlin Code
Study the example and understand each part.
fun main() {
val students = listOf(
"Brian",
"Mary",
"John",
"Amina"
)
for (student in students) {
println(student)
}
}
Kotlin is commonly developed using Android Studio or IntelliJ IDEA. These examples can be used as a foundation for Android application development.
Key Concept
A read-only list can be created with listOf().
Expected Output / Result
Brian Mary John Amina
Finished this lesson?
Mark it complete to update your course progress.