When passing the array of integer to a method and assigning it to different variables. Eg: to a=c,b=c; values changes in both a and b.
public static void main(String[] args) {
int arr[] = new int[]{1,2,3,4,5};
miniMaxSum(arr);
}
static void miniMaxSum(int[] arr) {
int[] a = arr;
int[] b =arr;
b[2] = 3;
//but here value changes in a also.
}