SCJP
Visit my download page
So repeat after me:
Java is pass-by-value.
(OK, once again... with feeling.)
Java is pass-by-value.
For primitives, you pass a copy of the actual value.
For references to objects, you pass a copy of the reference (the remote control).
You never pass the object. All objects are stored on the heap. Always.
Now go have an extra big cup of coffee and write some code.
SCJP
Visit my download page
Randall Twede wrote:all i can tell you is when passing parameters, everything in java is pass by value. so that even when you pass a reference(like "this" for example) you are still passing by value because the method gets a copy of the reference. you are not passing it the object but you are passing a separate reference to it. you can change that copy without changing the original.
not exactly what you asked, but along the same lines. i hope i explained that correctly.
SCJP
Visit my download page
Chandra shekar M wrote:Hi
Value Object is like a DTO/Bean which holds the user input data or data from model and Immutable. So that no one modifies it.
Reference Object are regular objects. Also even if the DTO/Bean which is mutable so that it can be modified by other components then it is called Reference Object.
Is this correct? Can any one add more differences?
Thanks
Chandra.
Not sure where a Reference Object would fit into things, unless it's what is now commonly called a Business Object.
SCJP
Visit my download page