Arrays are objects in Java. And references to objects are passed by value.

private void demo() {
int[] array = new int[5];
System.out.println(Arrays.toString(array)); // 0, 0, 0, 0, 0
fillArray(array);
System.out.println(Arrays.toString(array)); // 0, 1, 2, 3, 4
}

private void fillArray(int[] array) {
for (int i = 0; i < array.length; i++) {
array[i] = i;
}
}

ref : http://stackoverflow.com/questions/14062118/pass-array-by-reference-in-java

Why we should use Jenkins instead of windows task scheduler

Jenkins provide a lot of utilities that we do not have it on windows task scheduler

  1. Integrated logging system : instead of writing log ourself, jenkins provide a integrated log system
  2. Succeed/Failing email notification : in task scheduler, we have to write a script to send email ourself ( i.e. using PowerShell, etc. ).
  3. Progress tracking via web-based : no need to remote desktop
  4. Manual trigger the job : no need to remote desktop