'Java: void method returns values?

So, I think I misunderstood something about how method returns values. I don't understand why list[0] is 3 in the output since that is a void method, which doesn't return anything back to main method... If the void method could actually return the value, then why num would still be 0..... wouldn't num become 3 as well?? Or void method doesn't return any values, except arrays?

public static void main (String []args){

    int []list = {1,2,3,4,5};
    int number = 0;

    modify(number, list);

    System.out.println("number is: "+number);

    for (int i = 0; i < list.length; i++)
    {
        System.out.print(list[i]+" ");
    }

    System.out.println();
}
public static void modify (int num, int []list){

    num = 3;
    list[0] = 3;
}

Output:

number is: 0

3 2 3 4 5 


Solution 1:[1]

It doesn't return anything, it just modifies the variable list[0].

Solution 2:[2]

As mentioned above, the method isn't actually returning a value... it is modifying the first value in the array. The output is a reflection of the value modified by the 'modify'

Solution 3:[3]

list[0] = 3; is why you gave output 3. It has nothing to do with num and you did not return anything. You simply modified the content of the array.

Solution 4:[4]

When you declared "num" in the method, that is simply a new integer that has nothing to do with "number." Yes, you passed "number" into "num" in the method call, but you did not pass back "num" into "number," because in order to do that you would have had to return "num" specifically to the method call, which didn't happen because the return type was void. However, on the other hand, list[0] = 3 was in fact a successful modification to the array because it's not required for the array contents to be returned to the original method caller. Both the main method and the modify method already point to the same array in memory. But on the other hand, it's not clear from the computer's point of view that "num" and "number" point to the same thing in memory.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nhgrif
Solution 2 DawnFreeze
Solution 3 Michael Yaworski
Solution 4 Patrick