The count of lines in a journal

Report a typo

Please look at this code and write the number of INFO level log lines printed in the console.

import java.util.logging.*

object Main {
    @JvmStatic
    fun main(args: Array<String>) {
        val logger = Logger.getLogger(Main::class.java.name)
        Printer.splitter().forEach {
            if (it.length < 5) {
                logger.log(Level.INFO, it)
            }
        }
    }
}

object Printer {

    private const val text = "I like to study Kotlin. It is a simple programming language."

    fun splitter(): List<String> {
        return text.split(" ")
    }
}
Enter a number
___

Create a free account to access the full topic