I am coming from C/C++ world. I noticed in many posts that people do not accept to say that in Java there is "pass by reference" (for non-primitives); their argument is that, in this case, a copy of the reference is taken. I could not understand this justification since this is actually what happens in C when we pass by reference (a copy of the pointer is taken). For my little understanding in Java, I would say:
- Primitive types are passed by value.
- Non primitive types are passed by reference.
Am I wrong?