Last active
July 12, 2016 20:08
-
-
Save fluency03/de4a7c0d9aa368263feb1a077cbcad2c 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
/** | |
* This is a Scala script: scala-if.scala | |
*/ | |
val a = 1 | |
val b = 2 | |
var result1 = "" | |
if (a == b) { | |
result1 = "It's true"; | |
} else { | |
result1 = "Not really"; | |
} | |
println(s"$result1") | |
var result2 = "" | |
result2 = if (a == b) { | |
"It's true"; | |
} else { | |
"Not really"; | |
} | |
println(s"$result2") | |
val result3 = if (a == b) "It's true" else "Not really" | |
println(s"$result3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment