Last active
August 29, 2015 13:57
-
-
Save taitruong/9465709 to your computer and use it in GitHub Desktop.
Variable scope: inner / outer
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
object ScalaHackSession { | |
val i = 0 //> i : Int = 0 | |
val scope = "outer scope" //> scope : String = outer scope | |
if (i == 0) { | |
val scope = "inner scope" | |
println(scope + ": " + i) | |
} //> inner scope: 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment