Home »
MCQs »
Scala MCQs
What is the output of following code?
23. What is the output of following code?
val i = 43
i = 231
printf(i)
- 231
- 43
- 0
- Error
Answer: D) Error
Explanation:
The val keyword defines immutable values in Scala. [Read more: Scala Literal, Variables and Data Type]