变量的声明
2018-01-03 本文已影响0人
lehuai
打开cmd,输入scala,进入交互模式
scala> val a = 123
a: Int = 123
scala> var s = "java"
s: String = java
scala> s = "scala"
s: String = scala
scala> s
res0: String = scala
scala> val a: Int = 123
a: Int = 123
scala> var s: String = "scala"
s: String = scala