Perhaps this will help you understand.
In Java, this:
int[] tempArray = {1, 2, 3, 4};
means exactly the same thing as this:
int[] tempArray = new int[]{1, 2, 3, 4};
There is an implicit new
in the first form.
In Java, all arrays are heap objects / references. And when an array is passed to a method, it is handled the same way that any reference is handled; i.e. the reference is passed by value. (And no, this is NOT "call by reference" or "pass by reference" as those terms are properly understood.)