Wednesday, 18 September 2013

What is a reference in Java EXACTLY?

What is a reference in Java EXACTLY?

I have read a bunch of questions on stackoverflow, Can I pass parameters
by reference in Java?, Passing a String by Reference in Java?.
Let's say, I pass a reference of a string, x, to a method. The method
takes a copy of this reference, x', which still points to the original
object.
My question is: what is the difference between the two references now.
They point to the same object now.

No comments:

Post a Comment