What is the status of the input stream?

Report a typo

Look at this code:

fun main() {
    FileWriter("file.txt").use {
        it.write("Kotlin\nJava\nGo\nC++\nC#")
    }
    val file = FileReader("file.txt")
    file.use {
        val iterator = it.readLines().iterator()
        while (iterator.hasNext()) {
            println(iterator.next())
        }
    }
    try {
        println(file.ready())
    } catch (e: Exception) {
        println(e.message)
    }
}

What will be the last line printed to the console?

Select one option from the list
___

Create a free account to access the full topic