Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Your Email:

Pass-by-value Semantics in Java Applications

By Peter Haggar
2003-11-24


Pass-by-value semantics in Java applications

A few months ago, developerWorks posted some excerpts from my book, Practical Java, published by Addison-Wesley. I will initially use this column on developerWorks to answer some questions asked by readers and to respond to various comments about the excerpts.

The excerpt Understanding that parameters are passed by value and not by reference described the one and only parameter-passing mechanism in Java applications, pass by value. It was written to debunk the commonly held myth that Java applications pass parameters by reference, to avoid common programming mistakes that result from relying on pass-by-reference behavior.

Some of the feedback on this excerpt suggested that I was confusing the issue or was altogether wrong about it. Many of the readers who disagreed with me used the C++ language as an example. Therefore, in this column, I will use C++ and Java applications to further clarify the facts.



Tutorial Pages:
» Pass-by-value semantics in Java applications
» The key point
» Parameter passing in C++ and Java applications
» Examples
» Writing a swap method
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT