Re: pass by reference
- From: "Arved Sandstrom" <asandstrom@xxxxxxxxxxxxx>
- Date: Sat, 05 Apr 2008 12:01:49 GMT
"Lew" <lew@xxxxxxxxxxxxx> wrote in message
news:WpSdnSND4qHpiWvanZ2dnUVZ_uTinZ2d@xxxxxxxxxxxxxx
Andreas Leitgeb wrote:
Chase Preuninger <chasepreuninger@xxxxxxxxx> wrote:
All objects are "passed by reference" and all primitive types have
their value copied.
The objects are indeed passed by reference.
When I took a practice certification exam in Java, I was marked wrong for
saying that objects are passed by reference. The fact is that objects are
not passed at all - references are, and they are passed by value.
--
Lew
I think the terminology is bad. I prefer to look at it from a practical
standpoint - can I take the pointer to the Java object (and a pointer it
is), pass it into a method, and make changes to the object pointed to from
within the method, in such a way that those changes are reflected outside
the method? Yes. I may get flunked on a certification exam, but I call that
passing the object by reference.
AHS
.
- Follow-Ups:
- Re: pass by reference
- From: Roedy Green
- 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
- pass by reference
- Prev by Date: Re: Getting header info of a BMP file
- 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
|