Tutorial by Examples

Scala has the following built-in operators (methods/language elements with predefined precedence rules): TypeSymbolExampleArithmetic operators+ - * / %a + bRelational operators== != > < >= <=a > bLogical operators&& & || | !a && bBit-wise operators& | ^ ~ <...
In Scala you can define your own operators: class Team { def +(member: Person) = ... } With the above defines you can use it like: ITTeam + Jack or ITTeam.+(Jack) To define unary operators you can prefix it with unary_. E.g. unary_! class MyBigInt { def unary_! = ... } var ...
CategoryOperatorAssociativityPostfix() []Left to rightUnary! ~Right to leftMultiplicative* / %Left to rightAdditive+ -Left to rightShift>> >>> <<Left to rightRelational> >= < <=Left to rightEquality== !=Left to rightBitwise and&Left to rightBitwise xor^Left to ri...

Page 1 of 1