How does Arrays.sort() change the variable passed to it?
arrays, java, sorting
Solution
Yes, Java is pass-by-value. However, what is getting passed by value here is the reference to the array, not the array itself.
Problem
Possible Duplicate: Is Java pass-by-reference? I am a little confused here. How does Arrays.sort(a) modify the value of a? ``` int[] a = {9,8,7,6,5,4,3,2,1}; Arrays.sort(a); System.out.println(Arrays.toString(a)); ``` I thought java was pass by value...