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

Consider the following Scala program What does this program will print if

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

1 Expert Approved Answer
Step: 1 Unlock

To determine what this Scala program prints under different parameter passing modes lets analyze eac... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!