Nylige kommentarer

aloeverahe
Inhumane? Or Inhuman?

Adeline
Play with a frog? But... what if I can't find him?

Joker-Davian Williams
Com,mas everyw,h,ere commas, everywhere, commas don't, belong everywhere,

Jarod Kintz
Imma do both just in case.

a casual observer
Exactly! The edit function is there for a reason, so that we can improve other …

Mer

kalmyk's sitater

Alle sitater

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.