I am studying for the
SCJP. Please take the following code snippet.
Now I have no problem with lines I have commented, as it makes sense to me. What does not make sense to me is why d[0]++ or c[0]++ works.
c[0]++ --> seems to me this changes the value of final int[] c
since arrays are passed as reference d[0]++ seems like it changes the value of final int[] d = {3}; in the main method.
Is it only the memory address pointing to the array object that cannot be changed or reassigned? For some reason I figured that the values within the array were also unchangeable.
Can somebody please clarify for me?
Thanks,