A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Stan James:
Paul is right, but this usually needs a bit more clarification. Should probably be in the FAQ. Or probably is.
Whew! Did that make sense?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
So much sense that I used it to replace the present text in the FAQ (which was a little bit confusing, in my opinion).
Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Tony Morris
Java Q&A (FAQ, Trivia)
I am not completely useless.<br />I can be used as a bad example.<br /> <br />SCJP 1.4
Originally posted by Anoop Kavalloor:
Dear all,
just a simple solution. Java uses pass by value for both primitive and Objects. in case of primitive, it is a straight as an arrow. But for Object types,java passes the value of the reference. So what actually the calling method recieves is the copy of the reference of the object. hope it is clear.
Tony Morris
Java Q&A (FAQ, Trivia)
Paraphrase of madhu gadde:
Hi all,
which type of passing technique does java use?.
Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA
Originally posted by john prieur:
Therefore, authoritative sources call it pass-by-reference.
Tony Morris
Java Q&A (FAQ, Trivia)
Tony Morris
Java Q&A (FAQ, Trivia)
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Originally posted by Ernest Friedman-Hill:
Rick, Tony's got it right here -- he's addressing his comments to John, not to me. He agrees with me, and as we all know, I'm always right
Notice when an object is passed to a method, any changes that occur inside the method also occur to the object outside the method. This is because the reference variables ... both point to the same object. Hence, a change made within the method changes the data in the same object. The object was passed by reference.
Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA
No; passing a reference does not imply pass-by-reference. Pass-by-reference is not available in Java.If the argument is a primitive type, then it is passed by value. If the argument is a reference to an object, then it is considered pass-by-reference.
Therefore, authoritative sources call it pass-by-reference.
Originally posted by john prieur:
Tony and Ernest,
Thanks for your comments
See page 133 of Sun Certified Programmer for Java 2 ISBN 0-07-213208-6.
The italics are in the actual book for emphasis. That is the effect regardless of under-the-hood implementation details. Although training material is not as authoritative as specs, the explanations are sometimes clearer and equally reliable.
[ September 10, 2005: Message edited by: john prieur ]
Tony Morris
Java Q&A (FAQ, Trivia)
Don't listen to Steve. Just read this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|