You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example at create-integer-and-string-variables, for Scala uses immutable variable x to re-define it from Int to a String type. Solution would be to either use another variable say z or make the x variable of type var that will make it mutable.
val x = 1
val z = "Hi"
val y = """foo
bar
baz"""
or
var x = 1
var x = "Hi"
val y = """foo
bar
baz"""
The text was updated successfully, but these errors were encountered:
The example at create-integer-and-string-variables, for Scala uses
immutable
variablex
to re-define it fromInt
to aString
type. Solution would be to either use another variable sayz
or make thex
variable of typevar
that will make itmutable
.or
The text was updated successfully, but these errors were encountered: