The only identifiers that can be used as prefix operators are + , - , ! , and ~ .
If you want to change selection, open document below and click on "Move attachment"
Basic Types and Operations demonstrate this to yourself by typing the method call both via operator notation and explicitly:
scala> -2.0 // Scala invokes (2.0).unary_-
res2: Double = -2.0
res3: Double = -2.0
<span>The only identifiers that can be used as prefix operators are +, -, !, and ~. Thus, if you define a method named unary_!, you
could invoke that method on a value or variable of the appropriate type using prefix operator notation, such as !p. But if you define a me
last reprioritisation on
suggested re-reading day
started reading on
finished reading on
Do you want to join discussion? Click here to log in or create user.