Skip to content

Instantly share code, notes, and snippets.

@nicholasf
Created June 7, 2015 03:56
Show Gist options
  • Save nicholasf/6a290e8ee8f2ca12de83 to your computer and use it in GitHub Desktop.
Save nicholasf/6a290e8ee8f2ca12de83 to your computer and use it in GitHub Desktop.
scala> val foo = "one"
foo: String = one
scala> foo = "two"
<console>:19: error: reassignment to val
foo = "two"
^
scala> //fair enough! but ...
scala> val numbers = Array(1,2,3)
numbers: Array[Int] = Array(1, 2, 3)
scala> numbers(0) = 99
scala> numbers
res116: Array[Int] = Array(99, 2, 3)
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment