3 ms·
I know C# and Java, but not Scala. That is NOT at all clear for me. Why is: (new Foo).fiz = "fuz" // valid? fiz is Final! Why would you be allowed to re-ass
by deanCommie 11y ago
I know C# and Java, but not Scala.
That is NOT at all clear for me. Why is:
(new Foo).fiz = "fuz" // valid?
fiz is Final! Why would you be allowed to re-assign a final variable on an instance??
- bilalq 11y agoFinal does not mean immutable, but non-overridable through inheritance. The val keyword is what makes things immutable.