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?

  1. Character -> Float
  2. Float -> Long
  3. Short -> Integer
  4. Integer -> Double

Answer: B) Float -> Long

Explanation:

Float - > Long is not a valid type casting. [Refer diagram given here: Scala Type Casting]

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.