Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#odersky-programming-in-scala-1ed #scala
Question
So greetStrings(i) gets transformed into [...] .
Answer
greetStrings.apply(i)

Tags
#odersky-programming-in-scala-1ed #scala
Question
So greetStrings(i) gets transformed into [...] .
Answer
?

Tags
#odersky-programming-in-scala-1ed #scala
Question
So greetStrings(i) gets transformed into [...] .
Answer
greetStrings.apply(i)
If you want to change selection, open original toplevel document below and click on "Move attachment"

Parent (intermediate) annotation

Open it
So greetStrings(i) gets transformed into greetStrings.apply(i) .

Original toplevel document

Next Steps in Scala
an Java. Arrays are simply instances of classes like any other class in Scala. When you apply parentheses surrounding one or more values to a variable, Scala will transform the code into an invocation of a method named apply on that variable. <span>So greetStrings(i) gets transformed into greetStrings.apply(i). Thus accessing an element of an array in Scala is simply a method call like any other. This principle is not restricted to arrays: any application of an object to some arguments in paren

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised 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.