Although mutable sets offer an actual += method, immutable sets do not. In this case, jetSet += "Lear", is essentially [...]
Answer
a shorthand for jetSet = jetSet + "Lear"
Tags
#odersky-programming-in-scala-1ed #scala
Question
Although mutable sets offer an actual += method, immutable sets do not. In this case, jetSet += "Lear", is essentially [...]
Answer
?
Tags
#odersky-programming-in-scala-1ed #scala
Question
Although mutable sets offer an actual += method, immutable sets do not. In this case, jetSet += "Lear", is essentially [...]
Answer
a shorthand for jetSet = jetSet + "Lear"
If you want to change selection, open document below and click on "Move attachment"
Next Steps in Scala r differs.
Whereas a mutable set will add the element to itself, an immutable set will create
and return a new set with the element added. In Listing 3.5,
you're working with an immutable set, thus the + invocation will yield a brand
new set. <span>Although mutable sets offer an actual += method, immutable sets do
not. In this case, the second line of code, "jetSet += "Lear"",
is essentially a shorthand for:
jetSet = jetSet + "Lear"
Thus, in the second line of Listing 3.5, you reassign
the jetSet var with a new set containing "Boeing", "Airbus", and
"Lear". Finally, the last line of Lis
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised on
scheduled repetition
scheduled repetition interval
last repetition or drill
Details
No repetitions
Discussion
Do you want to join discussion? Click here to log in or create user.