The below Kotlin program will iterate through the collection using for loop.
fun main(args : Array<String>) {
var books = listOf("My Jungle Books", "There is green!")
for (book in books) {
println(book)
}
}
The above Kotlin program will display the following outcome:-
My Jungle Books There is green!