What is the difference between call-by-value and call-by-name function parameters?
Answer / Ravindra Kumar Suman
Call-by-value and call-by-name are two methods for passing arguments to functions in programming languages, including Scala. In Call-by-value, the actual argument value is evaluated before it's passed to the function, while in Call-by-name, the function call evaluates the argument expression only when its value is needed inside the function.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you define a function in scala?
What is a flatmap in scala?
Does a Companion object access private members of it’s Companion class in Scala?
What does raw method in scala string interpolation?
Like Java, what are the default imports in Scala Language?
What is the advantage of Scala?
What is the difference between :: and #:: in scala?
What is currying in scala?
What is pattern matching?
What is for-comprehension in scala?
What are the Java’s OOP constructs not supported by Scala? What are the Scala’s OOP constructs not supported by Java? What are the new OOPs constructs introduced by Scala, but not supported by Java?
What do you mean by option in scala and why it is used?