A good answer might be:First value of the local var: 7 Value of the parameter: 7 Second value of the local var: 7 | |
Changes to the Formal Parameter do not affect the CallerHere is the program again, with a slight change. Now the invoked method print() makes a change to its copy of the value in its formal parameter x.
Recall that this is using call by value which means parameters are used to pass values into a method, but not used to pass anything back to the caller. | |
QUESTION 4:Click Here after you have answered the question |