Home »
MCQs »
Scala MCQs
Based on Type Casting, which of these conversions is lossy or invalid?
25. Based on Type Casting, which of these conversions is lossy or invalid?
- Character -> Float
- Float -> Long
- Short -> Integer
- Integer -> Double
Answer: B) Float -> Long
Explanation:
Float - > Long is not a valid type casting. [Refer diagram given here: Scala Type Casting]