Scala / Scala interview questions
Type Casting in Scala.
Value types can be cast in the following order: Byte -> Short -> Int -> Long -> Float -> Double.
Also Char value type can be casted to Int.
The above orders are unidirectional and other castings lead to compilation error.
You can also cast a reference type to a subtype.
More Related questions...