News:

Who uses forums anymore?

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - shift

#1
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...

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.