Останні коментарі

Meredith Grey
Well, I think the writer would be begrieved to know that at the time of …

Orson Welles
We are born alone

Paige
The most perfect quote title doesn’t exi-

vantheman
You are not Mao Zedong diddy

Prophet Muhammad
Salallahu alaihi wasalim I am Muslim thank god.

Докладніше

kalmyk's цитат

Усі цитат

Dmitry Jemerov
Do you remember how children memorize the colors of the rainbow? "Richard Of York Gave Battle In Vain!" Imagine you need a function that gives you a mnemonic for each color (and you don't want to store this information in the enum itself). In Java you can use a switch statement for this. The corresponding Kotlin construct will be when. Like if, when is an expression that returns a value, so you can write a function with an expression body, returning the when expression directly.