Constants and Variables - Squeng/Polyglot GitHub Wiki
Scala has immutable variables and mutable variables. Remember that these are references to objects. An immutable variable thus means that the reference cannot be changed, but if the object pointed to by the reference is not immutable, the object itself could still be mutated.
val ir = "Immutable Variable"
var mr = "Mutable Variable"
Java has final variables and non-final variables. Remember that these are references to objects when they are not primitives. A final variable thus means that the reference cannot be changed, but if the object pointed to by the reference is not immutable, the object itself could still be mutated.
final var IR = "Immutable Variable" // or final String ir = "Immutable Variable"
var mr = "Mutable Variable" // or String mr = "Mutable Variable"
This is what an experienced developer and teacher has to say about Java's var
s: "With complex programs, I am conservative with the use of var and only use it when the type is blindingly obvious [...]. But in a script, I use var liberally. It's almost like in Python, except that you still have compile-time typing. In fact, it is better syntax than Python because you can distinguish between declaration and assignment."
Python has variables but no really final variables.
mr = 'Mutable Variable'