Passing Parameters to Functions in Java

Опубликовано: 22 Январь 2013
на канале: Bethany Petr
5,475
like

Passing a parameter to a function in Java.

Questions:
1) Write a sentence to describe the scope (where it exists) of a variable declared inside a function.
2) How can you share a value from main with another function?
3) Does the name of the parameter need to match the name of the variable you are sharing?
4) What happens to the value of a parameter you have changed inside a function once you return to main and check the value of the corresponding variable that you had passed to the function?
5) Why does that happen (re: question 4)?