A copy of the reference to the array is passed to each method so they can manipulate the contents of the array.
Type: Posts; User: Norm
A copy of the reference to the array is passed to each method so they can manipulate the contents of the array.
Do you understand how the compiler assigns memory locations to hold the value of a variable?
If you have this concept then I can explain what happens when the you call a method with some arguments.
A copy of the reference to the array is passed. It's that reference can't be changed.
Java passes arguments by value. The value of the variable is copied to a new location and that is given to the method.The original value of the variable is not reachable via the passed value.