Question
What does lazy val do?
Select an option. Your answer will be checked instantly.
Correct Answer: B. Evaluates and stores its expression only when first accessed
Explanation:
Lazy initialization postpones work until the value is needed.
After the first evaluation, the result is cached.
Leave a Reply