July 2017
Intermediate to advanced
796 pages
18h 55m
English
An implicit conversion from type S to type T is defined by an implicit value that has function type S => T, or by an implicit method convertible to a value of that type. Implicit conversions are applied in two situations (source: http://docs.scala-lang.org/tutorials/tour/implicit-conversions):
Well, we have seen how to use infix operator in Scala. Now, let's see some use cases of Scala implicit conversion. Suppose we have the following code segment:
class Complex(val real: Double, val imaginary: Double) { def plus(that: Complex) = new ...Read now
Unlock full access