Is arrays passed by reference to methods in java? If so, why the following code prints 1,2,3,4,5 instead of 5,4,3,2,1 ?

```
public class Test {
   public static void main(String[] args) {
      int[] oldList = {1, 2, 3, 4, 5};
      reverse(oldList);
      for (int i = 0; i < oldList.length; i++) {
          System.out.print(oldList[i] + " ");
      }
   }

   public static void reverse(int[] list) {
      int[] newList = new int[list.length];
      for (int i = 0; i < list.length; i++) {
          newList[i] = list[list.length - 1 - i];
      }
      list = newList;
   }
}

```

[enter image description here](https://i.stack.imgur.com/XPb7C.png)