Question 17
Back to Exercise
A method sets a[0] = 99 on the array it receives. Does the caller see the change?
- A No, Java is pass-by-value
- B Yes – the method receives a copy of the reference, which points to the same array Correct
- C Only for static methods
- D Only if the array is final
Correct Answer: Option B
Java is pass-by-value, but the value passed is the reference.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!