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

Neil Gaiman
fasttyper237

Barack Obama
Hello my name is Barack Obama (President of United States) 1,000 years ago sorry I’m …

SOME PERSON
Sorry Shutdown law or Cinderella Law in 2011 19 May and implementation in 2011 November …

Erudite
This isn't Russian

SOME PERSON
Roblox is banned in Kuwait, Qatar, Saudi Arabia (300 thousand games), Turkey (since 2024), Bahrain, …

Докладніше

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.