Scala Language Operators in Scala Built-in Operators

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Scala has the following built-in operators (methods/language elements with predefined precedence rules):

TypeSymbolExample
Arithmetic operators+ - * / %a + b
Relational operators== != > < >= <=a > b
Logical operators&& & || | !a && b
Bit-wise operators& | ^ ~ << >> >>>a & b, ~a, a >>> b
Assignment operators= += -= *= /= %= <<= >>= &= ^= |=a += b

Scala operators have the same meaning as in Java

Note: methods ending with : bind to the right (and right associative), so the call with list.::(value) can be written as value :: list with operator syntax. (1 :: 2 :: 3 :: Nil is the same as 1 :: (2 :: (3 :: Nil)))



Got any Scala Language Question?