Calculate the length

Report a typo

There is a file new.txt in src folder with this text:

Kotlin.

What is the output of this code?

fun main() {
    val fileName = "src/new.txt"
    val linesLength = File(fileName).length()
    val lines = File(fileName).readLines().size
    print("$linesLength $lines")
}
Enter a short text
___

Create a free account to access the full topic