‘Hello World’ #Kotlin #coding #fun

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Absolutely sen-sational! More like this please

BenKadel
Автор

perfect 😂😂
====
fun main() {
Hello World(println)

}
val println = { println("println") }
object Hello {
infix fun World(action: () -> Unit) = action()
}

Nixomia
Автор

It looks cursed, but it is perfectly valid Kotlin code :)

Not that you should create functions with backticks, but they are very nice when creating unit tests

fun main() {

`Hello World`(println)
}

fun `Hello World`(str: String) = println(str)
val println = "Hello World! :3"

MrPowerGamerBR
Автор

Great also printed the string as a character literal

gowthampv
visit shbcf.ru