Skip to content

Instantly share code, notes, and snippets.

@taitruong
Last active August 29, 2015 13:57
Show Gist options
  • Save taitruong/9465605 to your computer and use it in GitHub Desktop.
Save taitruong/9465605 to your computer and use it in GitHub Desktop.
val and var - the good and the the ugly
object ScalaHackSession {
val immutable: String = "Hello, Scala" //> immutable : String = Hello, Scala
var mutable = immutable //> mutable : String = Hello, Scala
mutable = "Hello, Hacker"
println(mutable) //> Hello, Hacker
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment