Home »
MCQs »
Scala MCQs
Lazy initialization is –
31. Lazy initialization is -
- Creating variables using the lazy keyword
- Done only on immutable variables
- Calculated at its first access
- All of the above
Answer: D) All of the above
Explanation:
Lazy initialization variables are those variables that are calculated when the first time they are accessed. Scala mutable variables cannot be lazy.