#odersky-programming-in-scala-1ed #scala
greetStrings( 0 ) = "Hello"
will be transformed into:
greetStrings.update( 0 , "Hello" )
If you want to change selection, open document below and click on "Move attachment"
Next Steps in Scala parentheses and one or more arguments have
been applied, the compiler will transform that into an invocation of an update method that takes the
arguments in parentheses as well as the object to the right of the equals sign.
For example:
<span>greetStrings(0) = "Hello"
will be transformed into:
greetStrings.update(0, "Hello")
Thus, the following is semantically equivalent to the code
in Listing 3.1:
val greetStrings = new Array[String](3)
greetStrings.update(0, "Hello")
greetStrings.updat Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details