Scala / Scala interview questions
Explain about Scala variables.
There are 2 types of variables in Scala, val and var. A value variable (val) is constant and its value cannot be changed once assigned. It is immutable, while a regular variable (var), is mutable, and you can change the value.
val exVal: Int=10 // cannot be changed var exVar : Int=11
More Related questions...