Scala operators
Translation results:
Scala is the abbreviation of Scalable Language and is a multi-paradigm programming language
Martin Odersky of the Ecole Polytechnique Fédérale de Lausanne (EPFL) began designing Scala in 2001 based on the work of Funnel.
Funnel is a programming language that combines functional programming ideas with Petri nets.
Scala operatorssyntax
An operator is a symbol that tells the compiler to perform specified mathematical and logical operations.
Scala has a rich set of built-in operators, including the following types:
Arithmetic operators
Relational operators
Logical operations operator
bit operator
assignment operator
Scala operatorsexample
object Test { def main(args: Array[String]) { var a = 10; var b = 20; var c = 25; var d = 25; println("a + b = " + (a + b) ); println("a - b = " + (a - b) ); println("a * b = " + (a * b) ); println("b / a = " + (b / a) ); println("b % a = " + (b % a) ); println("c % a = " + (c % a) ); }}