scala運算符
Scala的符號運算符 (Scala's symbolic operators)
The symbolic operators in Scala are symbols that have a specific?task that they perform when called in a Scala program.?Scala library defines a lot of symbols?that can be used?while programming?in Scala.
Scala中的符號運算符是具有在Scala程序中調用的特定任務的符號。 Scala庫定義了許多在Scala中編程時可以使用的符號。
Here is a list of all valid Scala symbolic operators,?you can?go to our?tutorial on Scala operators to get a deep knowledge of operators used in Scala programming language.
這是所有有效的Scala符號運算符的列表,您可以轉到我們的Scala運算符教程,以深入了解Scala編程語言中使用的運算符。
There are four types of symbols are used in Scala:
Scala使用四種符號類型 :
1) Keywords/ reserved symbols
1)關鍵字/保留符號
There are symbols in Scala programming language that have a specific utilization and are reserved for that.
Scala編程語言中有一些具有特定用途的符號,并且為此保留了這些符號。
Keywords: '' , '=>'
關鍵字 :' ',' => '
Reserved symbols: '(' , ')' , '[' , ']', '{', '}', '.', '// /* */' , '#' , ':' , '<:>: <% ' , '' , ' '' "" ', ' ' ', '@' , ',', ';', '_*', '_'
保留符號 :' ( ',' ) ',' [ ',' ] ',' { ',' } ',' 。 ',' // / * * / ',' # ',' : ',' <:>:<% '' '' '' “””, '' ',' @ ',' , ',' ; ',' _ * ',' _ '
2) Automatically import methods
2)自動導入方式
The default imports are,
默認導入為
import _root._java.lang._
導入_root._java.lang._
import _root._scala._
導入_root._scala._
import _root._scala._Predef._
導入_root._scala._Predef._
ArrowAssoc : ->
ArrowAssoc:->
3) Common methods
3)常用方法
These are those symbols that are methods to some classes,
這些符號是某些類的方法,
'++', '.++', '.::', '+:',
' ++ ',' 。++ ',' 。:: ',' +: ',
4) Syntactic sugars/ compositions
4)語法糖/成分
These are those symbols that may hide a method,
這些是可能隱藏方法的符號,
'=', '(_+_)'
' = ',' (_ + _) '
翻譯自: https://www.includehelp.com/scala/what-do-all-scala-symbolic-operators-mean.aspx
scala運算符