Using Val,var to declare variables in Scala,
Scala writes the type of a variable or function behind a function or variable such as Var greet:string
You can put multiple values or variables together in Scala for example: Var greeting, age:string
Scala uses methods, rather than forcing type conversions, to convert between numeric types such as: 5.21.toInt get a, 99.toChar get ' C '
No operator + + in Scala with counter + = 1
Operators are allowed to be overloaded in Scala
There is no static method in Scala, but a class pair should have a companion object in Scala, like a static method in Java, for example, the bigint companion object of the BigInt class has a Probableprime method that generates the specified number of bits. Bigint.probableprime
Scala methods without parameters usually have no parentheses for example: "Hello". Distinct
If S is a string, in Scala s (i) is the string I string, and in Java to write S.charat (i)
BigInt ("1234567") is shorthand for bigint.apply ("1234567"), which produces a new object and does not use the Apply method of the common companion object in New,scala to build the object
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The first chapter of Scala learning