Using collections

Report a typo

Take a look at this code snippet.

fun main() {
    val animals = setOf("dog", "cat", "snake", "mouse")
    var animalsIterator = animals.iterator();
    for(animal in animals){
        println(animal)
    }
    while (animalsIterator.hasNext()) {
        print("${animalsIterator.next()} ")
    }
    animalsIterator.next()
}

Choose the true statement about it.

Select one option from the list
___

Create a free account to access the full topic