Changing the Parameter Does Not Change the Original

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page

Answer:

Nothing.

Changing the Parameter Does Not Change the Original

parameter x

 

Here is the picture again, just after the statement

    x = 0;

in the zero() method has executed:

The statement x = 0 changes only the formal parameter x. The variable value in the caller is not changed.

QUESTION 5:

As far as the main() method is concerned, what has been the effect of the zero() method?