This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java - pass by value and pass by reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java - pass by value and pass by reference" Watch "Java - pass by value and pass by reference" New topic
Author

Java - pass by value and pass by reference

marlajee Borstone
Ranch Hand

Joined: Jun 26, 2008
Posts: 35
Hi friends, I find this site as great site to increase knowledge. Thanks to JavaRanch !!

As I am stuck today as I could read somewhere Java supports only Pass-by-value and not pass-by-reference.

Can someone prove it that Java does not support Pass-by-Reference. I want to see some java beginner level code example for proof.

regards,
Dhaansumall
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624



This question gets asked a lot. Take a look at this and this recent threads on the subject. You can also search the beginner forum for pass by value and find a number of discussions on the subject.
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

You can also take a look at the Pass By Value campfire story (a fun name for a lesson) here at JavaRanch. It does a nice job of explaining the concept, and has some examples. Things get a little more confusing when dealing with objects and references to objects. The campfire story can help clear things up.
[ July 26, 2008: Message edited by: Mark Vedder ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java - pass by value and pass by reference
 
Similar Threads
There is no pass by reference in java ?
pass by value or pass by reference
Java - pass-by-value or pass-by-reference ?
Is java "pass by value" or "pass by reference"
pass by reference