首页 > 代码库 > Scala 类型

Scala 类型

val 不可变

var 可变

val x:int = 1

val x = 1


scala> val decimal = 11235L
decimal: Long = 11235


scala> val hexa = 0x23
hexa: Int = 35


scala> val i = 1
i: Int = 1


scala> val i2: Byte = 1
i2: Byte = 1


scala> val d = 0.0
d: Double = 0.0


scala> val f = 0.0f
f: Float = 0.0

scala>val exponent = 1e30
exponent: Double = 1.0E30


val s = "wsevwev"

技术分享

技术分享

Scala 类型