What is the difference between a var
and val
definition in Scala and why does the language need both? Why would you choose a val
over a var
and vice versa?
What is the difference between a var
and val
definition in Scala and why does the language need both? Why would you choose a val
over a var
and vice versa?