|NO.Z.00008|——————————|BigDataEnd|——|Hadoop&Scala.V08|——|Scala.v08|Scala编程|操作符|
一、操作符
### --- 操作符
~~~     Scala的算术操作符、位操作符与 Java中的效果一样的。
~~~     需要特别注意一点:Scala中的操作符都是方法
~~~     书写时推荐使用:a + b 、1 to 10这种代码风格。
~~~     Scala 没有提供 ++、-- 操作符,但是可以使用+=、-=### --- a + b 等价 a.+(b)
scala> 1 + 2
res25: Int = 3
scala> 1.+(2)
res26: Int = 3### --- 1 to 10 等价 1.to(10)
scala> 1 to 10
res27: scala.collection.immutable.Range.Inclusive = Range 1 to 10
scala> 1.to(10)
res28: scala.collection.immutable.Range.Inclusive = Range 1 to 10Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor
 
                     
                    
                 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号 
