>Passing a reference of an object thorugh value is passing by reference.
No, the reference is passed by value, so it's not passing by reference. Google for "java pass reference", it's a common misunderstanding.
Aye, i understand what you, and the 2nd poster, and the google searches are saying.
I understand its not "pass by reference", instead, the reference is passed by value. I understand trust me. However, do you really know what that means?
"
When the argument is of primitive type, pass-by-value means that the method cannot change its value. When the argument is of reference type, pass-by-value means that the method cannot change the object reference, but can invoke the object's methods and modify the accessible variables within the object. "
Do you see how the pass-by-value changes definition here?
This is due, beacuase the reference is the value, and with that reference you can change the object. Thus, you can logically say, it is pass by reference, since the reference = value.
If you want to get sticky to terminology, you are right, you can not pass by reference, only value, but the OP is not trying to understand this.
I think i can safely say, that when you are talking java, you can say objects are passes by reference, since it invokes differently than with primitive types.