scala数据类型

# Scala数据类型
## 1.数值类型
### 1.1 与Java一样Scala也有8种数值类型
* Byte
* Char
* Short
* Int
* Long
* Float
* Double
* Boolean
### 1.2 其它数值类型
* BigInt = java.math.BigInteger
* Decimal = java.math.BigDecimal
### 1.3 用法
* 1.4.toInt => 1
* 99.toChar => c
* 'A'.toInt => 65
### 1.4 操作符
a + b => a.+(b)
* \+
* \-
* \*
* \/
* \%
* \&
* \|
* \^
* \>>
* \<<
* +=
* -=
### 1.5 函数和方法
* __方法和对象相关,函数和对象无关。__
* 方法:

def method(age: Int): Unit = {
println("Your age is " + age + ".")
}






http://www.cnblogs.com/nowgood/p/scalastartup.html#_nav_3


posted @ 2018-04-19 17:54  chenzechao  阅读(742)  评论(0编辑  收藏  举报