Re: pass by reference
- From: Andreas Leitgeb <avl@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 06 Apr 2008 17:35:57 GMT
Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx> wrote:
With objects, Java still does a). The parameter is a variable that
references the object. It's not the object itself. And a copy of that
reference the variable holds is passed. If Java did support
pass-by-reference, and you passed an object reference "by reference", then
reassigning the reference would not change the original object, but rather
would change the variable that was pointing to (referencing) that object.
I dare the bold assumption, that all partitioners in this discussion do
know how java works.
We're only discussing human language here, not Java's features.
a) Does anyone disagree, that "pass an Object by reference" and
"pass the reference to an Object by value" refer to the same
technical feature?
b) Does anyone disagree that "pass a reference by reference" is an
entirely different feature that is not directly supported by
java, but can be effectively mimicked with arrays and/or Holder-
classes?
Would anyone care to point out any difference of the two concepts in
"a)" without mixing it up with the concept in "b)" ?
In C#, you can additionally pass parameters by reference, including references.
This is also "pass ... by reference", but with C#'s meaning of references,
whereas Java's "pass Objects by reference" is based on java's "references".
Therefore "pass by reference" means something different depending on
the language context.
If you insist on saying that passing a reference to an object is "passing
by reference", then what does it mean to pass a reference by reference, as
you can do in C# (and C++ for that matter)?
exactly that: "pass a reference by reference" :-)
.
- Follow-Ups:
- Re: pass by reference
- From: Lasse Reichstein Nielsen
- Re: pass by reference
- From: Chris Smith
- Re: pass by reference
- From: Peter Duniho
- Re: pass by reference
- From: Lew
- Re: pass by reference
- References:
- pass by reference
- From: angelochen960@xxxxxxxxx
- Re: pass by reference
- From: Chase Preuninger
- Re: pass by reference
- From: Andreas Leitgeb
- Re: pass by reference
- From: Lew
- Re: pass by reference
- From: Arved Sandstrom
- Re: pass by reference
- From: Roedy Green
- Re: pass by reference
- From: Arved Sandstrom
- Re: pass by reference
- From: Peter Duniho
- pass by reference
- Prev by Date: Base Converter Calculator
- Next by Date: Re: pass by reference
- Previous by thread: Re: pass by reference
- Next by thread: Re: pass by reference
- Index(es):
Relevant Pages
|