Created
March 3, 2019 11:29
-
-
Save MarcinMoskala/e5b61c80840ad21615497be14e817f45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun processPerson(person: Person?) { | |
val name = person?.name ?: return | |
val surname = | |
if(person.surname.isNotBlank()) person.surname | |
else return | |
//... | |
} | |
fun describeNormalNum(num: Int) { | |
val description = when { | |
num % 2 == 0 -> "Is even" | |
num % 2 == 1 -> "Is odd" | |
else -> return | |
} | |
print(description) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment