Question: Consider the following Scala program What does this program will print if we make the following assumptions about the parameter passing modes for the parameters
Consider the following Scala program

What does this program will print if we make the following assumptions about the parameter passing modes for the parameters x and y of params:
1. both x and y are call-by-value
2. x is call-by-reference and y is call-by-value
3. x is call-by-value and y is call-by-name
4. x is call-by-reference and y is call-by-name
def params x Int, y Int) println(x); var z -1; params (z, z + 1); println (z)
Step by Step Solution
There are 3 Steps involved in it
To determine what this Scala program prints under different parameter passing modes lets analyze eac... View full answer
Get step-by-step solutions from verified subject matter experts
