scala运算符_Scala的所有符号运算符是什么意思?

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运算符

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值