<@U56EJ2Y2F> I don't understand Mike's example bu...
# random
p
@lefryskai I don't understand Mike's example but from what I understand
val
means that the variable can not be reassigned but the object it is pointing to can be mutated as in standard Java. e.g.:
Copy code
val a = Person("Mike")
a = Person("Gael") // compile error here
a.name = "Gael" // compiles fine
if you used
var
in this example there would be no compile error at all.
👍 1