Misinformation is tainted information.
As an example, let's see if we pass the "values" of an array, or the reference to the array in a test case...
As you can see through execution, the point gets proven... If it passed only the value, then me assigning to that "value" wouldn't change it for the original method, thus proving your statements incorrect.
In second case, I refer you to Java's own specifications, opcode 0x01, mnemonic [tex]ACONST-NULL[/tex]
Notice the wording, reference.
As an example, let's see if we pass the "values" of an array, or the reference to the array in a test case...
Code Select
public final class ArrayTest {
public static void test(int array[]) {
array[0] = 6;
}
public static void main(String args[]) {
int tvar[] = new int[] {0, 1, 2, 3, 4, 5};
test(tvar);
for(int i : tvar) {
if(i == 6) {
System.out.println("Point proven.");
break;
}
}
}
}
As you can see through execution, the point gets proven... If it passed only the value, then me assigning to that "value" wouldn't change it for the original method, thus proving your statements incorrect.
In second case, I refer you to Java's own specifications, opcode 0x01, mnemonic [tex]ACONST-NULL[/tex]
Quote from: JVM SpecsPush the null object reference onto the operand stack.
Notice the wording, reference.