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
What does + really stand for in 2 + 3?
Answer
it is a method call: (2).+(3)
method is named "+"

Tags
#odersky-programming-in-scala-1ed #scala
Question
What does + really stand for in 2 + 3?
Answer
?

Tags
#odersky-programming-in-scala-1ed #scala
Question
What does + really stand for in 2 + 3?
Answer
it is a method call: (2).+(3)
method is named "+"
If you want to change selection, open document below and click on "Move attachment"

Next Steps in Scala
n write "Console println 10". Scala doesn't technically have operator overloading, because it doesn't actually have operators in the traditional sense. Instead, characters such as +, -, *, and / can be used in method names. Thus, <span>when you typed 1 + 2 into the Scala interpreter in Step 1, you were actually invoking a method named + on the Int object 1, passing in 2 as a parameter. As illustrated in Figure 3.1, you could alternatively have written 1 + 2 using traditional method invocation syntax, (1).+(2). Figure 3.1 - All operations are method calls in Scala. Another important idea illustrated by this example will give you insight into why arrays are accessed with parentheses in Scala

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.