Kotlin Trivia 2

From time to time, we play with Kotlin just for fun and come with trivia. Let’s play with us!

Let’s play another Kotlin trivia with us today!

The trivia 🔗

Add 3 lines of code outside the main function to make it print: Thank you, JetBrains!

fun main() {
    Localazy `❤️` Kotlin

The solution 🔗

The solution is very simple. Just create an infix function with Unicode name wrapped in backticks.

private infix fun Unit.`❤️`(text: String) = println(text)
private val Localazy = Unit
private val Kotlin = "Thank you, JetBrains!"

fun main() {
    Localazy `❤️` Kotlin

See the whole project on Github.

Do you like it? Do you have your own trivia? Let us know!

💙 Join Localazy today

Translating has never been easier. Try Localazy for free.

Sign up