NOTE: This is a very old post that I’ve migrated from my tumblr account.
I have matured since then and continue to learn, striving to remain humble with a mindset of humility.
Defining Variables in Scala
Two Types of Variables
val
(immutable)var
(mutable)
Example: Immutable val
|
|
Note:
val
is not the same asconst
in C++. (See: Javafinal
vs. C++const
.)
Example: Mutable var
|
|