Type a method that mutates through the reference (visible to caller)
Type a method that mutates through the reference (visible to caller)
Answer
static void zeroFirst(int[] arr) { arr[0] = 0; }
arr is a copy of the reference, but both point to the same array. Setting arr[0] mutates the shared object — the caller sees the change.