Question: See the section above for guidelines that you should follow to create the file containing your answers to Part I. (3 points) Consider the following
See the section above for guidelines that you should follow to create the file containing your answers to Part I.
-
(3 points) Consider the following static method, which operates on an array of integers:
}
Consider the following code fragment, which calls this method:
In section 1-1 of ps2_partI, weve provided a table that you should complete to illustrate the execution of the loop during the above method call.
We have started the table for you. The first row shows what the array looks like before the start of the for loop. For each value of the loop variable i, include a row in the table that shows what the array looks like at the end of the iteration of the loop for that value of i. You may not need all of the rows of the table.
(Note: You should write the value of values as an array literal that shows the current contents of the array, even though the variable itself actually holds a reference to the array.)
-
(1 point) What does the array represented by values look like just before the call to mystery returns?
-
(2 points) After running the code fragment from part 1, we then execute the following statement:
Do we see the original array, or do we see the changes made by the call to the mystery() method? Explain briefly why your answer makes sense.
(Note: If you want to check your answer, youll need to import the java.util package at the top of your test class so that you can use the Arrays.toString() method.)
MUST ANSWER IN THE FOLLOWING TABLE AND QUESTIONS

Problem 1: Understanding code that uses an array 1-1) i values {1, 3, 5, 7, 9, 11, 13} 0 1-2) contents of array just before the method returns: {} 1-3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
