Chapter 5, 5.4

1. Explain the difference between formal parameters and actual parameter.
–The formal parameter is the variables decleared in the server code, listed in the method definition. And the actual parameter is the values in th client code assigned to the formal parameter which are eventually shown.

2. How does Java transmit data by means of parameters?
–Java transmit data by assigning the actual parameters to the formal parameters before running all the other methods under that method.

3. Define a method sum. This method expects two integers as parameters and returns the sum of the numbers ranging from the first integer to the second one.
–public int getSum (int x, int y){
while (sum< y) {
sum = x +1
x++
}

4. What is the purpose of local variables?
–It’s a method that can only be used inside the method.

Leave a Comment