July 2017
Intermediate to advanced
796 pages
18h 55m
English
It's worth mentioning that Scala doesn't support the operator overloading. You might think that there are no operators at all in Scala.
An alternative syntax for calling a method taking a single parameter is the use of the infix syntax. The infix syntax provides you with a flavor just like you are applying an operator overloading, as like what you did in C++. For example:
val x = 45val y = 75
In the following case, the + means a method in class Int. The following code is a non-conventional method calling syntax:
val add1 = x.+(y)
More formally, the same can be done using the infix syntax, as follows:
val add2 = x + y
Moreover, you can utilize the infix syntax. However, the method has only a single parameter, as follows: ...
Read now
Unlock full access