Saturday, January 3, 2015

Is Java pass-by-value or pass-by-reference?

There is a very common misconception that Java is pass-by-reference. The difficult thing to understand is that Java passes objects as references and those references are passed by value. The Java Spec says that everything in Java is pass-by-value. There is no such thing as "pass-by-reference" in Java. So Java is always pass-by-value.



from dzone.com: latest front page http://www.dzone.com/links/r/is_java_passbyvalue_or_passbyreference.html

No comments:

Post a Comment