Last active
November 27, 2021 10:54
-
-
Save nbness2/5af651ce6704e37ad00d82d39a83c0b8 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
val random = Random() | |
val randomNumber = random.nextInt() | |
val message = "Number is {0}" | |
val sign: String | |
if (randomNumber > 0) { | |
sign = "positive" | |
} else if (randomNumber < 0) { | |
sign = "negative" | |
} else { | |
sign = "zero" | |
} | |
println(MessageFormat.format(message, sign)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment