What is the output of following code?

23. What is the output of following code?

val i = 43
i = 231
printf(i)
  1. 231
  2. 43
  3. 0
  4. Error

Answer: D) Error

Explanation:

The val keyword defines immutable values in Scala. [Read more: Scala Literal, Variables and Data Type]

Comments and Discussions!

Load comments ↻






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